How to get the last 10 records from a table



IBM's flagship relational database management system

Re: How to get the last 10 records from a table

Postby progressabhi1 » Wed Apr 30, 2008 5:14 pm

Hi
The above query sent by me will work only in DB2 version 7.0 and above.
Regards
Abhi
progressabhi1
 
Posts: 17
Joined: Tue Apr 01, 2008 6:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the last 10 records from a table

Postby CICS Guy » Wed Apr 30, 2008 7:24 pm

progressabhi1 wrote:The above query sent by me will work only in DB2 version 7.0 and above.
Are you saying that you do not have version 7? What version do you have?
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the last 10 records from a table

Postby dick scherrer » Wed Apr 30, 2008 9:53 pm

Hello,

What if seq_no is not a numeric field?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to get the last 10 records from a table

Postby progressabhi1 » Tue May 06, 2008 9:36 am

"Are you saying that you do not have version 7? What version do you have?"

Hi
I mean to say that "FETCH FIRST 20 ROWS ONLY" works in ver7 & above as per my knowledge.I'm using version 7.1.

Regards
Abhi
progressabhi1
 
Posts: 17
Joined: Tue Apr 01, 2008 6:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the last 10 records from a table

Postby progressabhi1 » Tue May 06, 2008 9:38 am

dick scherrer wrote:Hello,

What if seq_no is not a numeric field?



Hi
Ya, u r correct.If its not numeric field than we will have to use concept of application programming & do any sorting e.g. radix sort etc.

Regards
Abhi
progressabhi1
 
Posts: 17
Joined: Tue Apr 01, 2008 6:07 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DB2

 


  • Related topics
    Replies
    Views
    Last post