Subject | Re: [firebird-support] Badly need your Help-Very urgent |
---|---|
Author | Daniel Albuschat |
Post date | 2006-07-25T14:37:47Z |
2006/7/25, Graeme Edwards <g.edwards@...>:
Hm that's indeed not a simple problem. I think you can gain the fastest
results when you write a stored procedure that selects the wanted
rows from user and then join this stored proc to userproperties.
set term ^;
create procedure select_users(i_first integer, i_skip)returns(userid
integer, username varchar(10) /* or whatever */) as
begin
for select first :i_first skip :i_skip userid, username from user
into :userid, :username do
begin
suspend;
end
end^
select * from select_users(21,19) u left join userproperties p .....
The code is untested, it's not guaranteed to work. But you should get
what I mean.
I don't know whether it's ok to give the argiments to first and skip
as parameters....
probably it's not.
Regards,
Daniel Albuschat
--
eat(this); // delicious suicide
> My guess would be more along the lines ofAh, now I see what he means.
>
> Select * from user left outer join userproperties on . where user.userid in
> (Select first 21 skip 19 userID from User)
Hm that's indeed not a simple problem. I think you can gain the fastest
results when you write a stored procedure that selects the wanted
rows from user and then join this stored proc to userproperties.
set term ^;
create procedure select_users(i_first integer, i_skip)returns(userid
integer, username varchar(10) /* or whatever */) as
begin
for select first :i_first skip :i_skip userid, username from user
into :userid, :username do
begin
suspend;
end
end^
select * from select_users(21,19) u left join userproperties p .....
The code is untested, it's not guaranteed to work. But you should get
what I mean.
I don't know whether it's ok to give the argiments to first and skip
as parameters....
probably it's not.
Regards,
Daniel Albuschat
--
eat(this); // delicious suicide