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 |
monayme
Starting Member
1 Post |
Posted - 2006-06-27 : 06:46:34
|
I am trying to identify the last observation in a group. If you are familiar with SAS, then the equivalent SAS code is LAST.varname. I'd like to tag it as LAST while the others should be OTHERS.How do you do this in SQL? Thanks! |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-18 : 06:42:25
|
What is "last"? Last by time? Last by alphabet?Peter LarssonHelsingborg, Sweden |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-18 : 11:43:44
|
I think MSAccess has First and Last function. If that doesnt give the answer you want, post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-22 : 01:07:07
|
Without an ORDER BY, First or Last picks the record in physical order in the database.Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|