Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-11-15 : 07:39:05
|
| narendra writes "hi, i want to display last 'n' records in my table, it does'nt contain any identity column or time stamp, and i want the result as they r stored in the table. one more query is how to display the records in reverse order like from bottom to top of da tableregardsnaren" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-15 : 08:03:26
|
| There is should be some unique columns to do thisCopy the data to other table with Identity and Use Top and Order by--Top 10Select top 10 columns from yourTable order by uniqueCol Asc--Bottom 10Select top 10 columns from yourTable order by uniqueCol DescMadhivananFailing to plan is Planning to fail |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-11-15 : 08:39:29
|
| Data has no order in a database unless you specify one. The concept of FIRST or LAST is meaningless without a sort order, and you cannot rely on getting the same results each time you run your statement. |
 |
|
|
|
|
|