|
| |
|
|
sssngt83
Posts: 31 Joined: 10/8/2007 Status: offline
|
SQL database question ! - 1/16/2008 0:37:23
How to show the bottom records ?? Like if want show top 10 record is like " SELECT TOP 10 * FORM .... "
|
|
|
|
ou812
Posts: 1601 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: SQL database question ! - 1/16/2008 1:04:47
I'm guessing you have some criteria in your query, and would therefore just "order by desc" instead. Maybe I'm not understanding though.
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
sssngt83
Posts: 31 Joined: 10/8/2007 Status: offline
|
RE: SQL database question ! - 1/16/2008 3:55:28
Sorry my question not clear... I mean if i want show bottom 10 record, how to write the coding to call them out ?? Just simply change "TOP" to "BOTTOM" ??
|
|
|
|
ou812
Posts: 1601 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: SQL database question ! - 1/16/2008 10:35:14
Right now, I would assume your query is something like "select top 10 * from table order by col1", so that you have some order to your query in getting the top 10. Then to get the bottom 10, you change it to "select top 10 * from table order by col1 desc" Bottom is not a keyword, so you just sort them in the opposite order and choose the top 10 again, which gives you the bottom of the previous query.
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|