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 |
|
norty911
Starting Member
41 Posts |
Posted - 2007-10-15 : 09:06:22
|
| Hey guys, is there an easy way to select the very last record in a table? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-10-15 : 09:07:51
|
what is your definition of last record ?you can use TOP 1 with ORDER BY ASC or DESC to do it. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-15 : 09:07:55
|
| Define what you mean by "Very Last Record". In relational world there is no First or Last record. In fact, you can't retrieve any record based on position.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-15 : 09:14:33
|
Mere 4 secs!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-15 : 09:21:59
|
quote: Originally posted by norty911 Hey guys, is there an easy way to select the very last record in a table?
Does your table have identity column/datetime column?MadhivananFailing to plan is Planning to fail |
 |
|
|
norty911
Starting Member
41 Posts |
Posted - 2007-10-15 : 10:52:52
|
| Thanks for the replies... have found my solution - similar to what khtan |
 |
|
|
|
|
|