Subject | Select last n rows |
---|---|
Author | guru |
Post date | 2005-04-21T18:09:56Z |
Hi,
I'm trying to get last n rows from the query. It looks like
select degree, degree_type
from ga_degree
where degree is not NULL
order by entry_date
Lets say we have 100 rows in a table. All have different "entry_date".
I want to get "last n rows" from ga_degree.
Can not change order by clause because;
the result of a sp ( yes this is a sp ) is a string and that is :
'0056730236'. ( something like that )
Every digit represents a "degree" which was retrieved from guery.
Most left is smaller date's degree. And most right is the last degree
entry..
That why can't use "select first n ..... order by entry_date desc".
Well, with my poor English, thats all I can tell :)
Thanks for help...
---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0516-6, 20.04.2005
Tested on: 21.04.2005 21:10:01
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com
I'm trying to get last n rows from the query. It looks like
select degree, degree_type
from ga_degree
where degree is not NULL
order by entry_date
Lets say we have 100 rows in a table. All have different "entry_date".
I want to get "last n rows" from ga_degree.
Can not change order by clause because;
the result of a sp ( yes this is a sp ) is a string and that is :
'0056730236'. ( something like that )
Every digit represents a "degree" which was retrieved from guery.
Most left is smaller date's degree. And most right is the last degree
entry..
That why can't use "select first n ..... order by entry_date desc".
Well, with my poor English, thats all I can tell :)
Thanks for help...
---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0516-6, 20.04.2005
Tested on: 21.04.2005 21:10:01
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com