Subject Re: [firebird-support] FIRST m SKIP n problem
Author Helen Borrie
At 01:22 PM 31/10/2003 +0100, you wrote:

>Hi there,
>
>I have a table that contains several records per person per day, as:
>name,datetime,blabla
>joe,2003-10.31-08.00,test1
>joe,2003-10.31-09.00,test2
>joe,2003-10.31-10.00,test3
>joe,2003-10.31-11.00,test4
>joe,2003-10.31-12.00,test5
>etc
>
>I want to retrieve the last 4 things joe has done, ordered by datetime (asc).
>
>So using FIRST 4 and use 'desc' order is not ok... :-(
>
>How can I do that (using FB1.03)?

select first 1 skip 3 blah order by testdate desc
union
select first 1 skip 2 blah order by ...
union
select first 1 skip 1 blah order by...
union
select first blah order by...

h.




>regards,
>Yves
>
>
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/