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 |
|
sangoku
Starting Member
19 Posts |
Posted - 2009-09-04 : 13:02:27
|
| I know i posted already one stupid question but i will do another. I am currently on a test where the professor is putting us some assignments and i am listening, not my turn yet, but it came to me, i cant remember how to put a limiter into a where limiterlike select row, count row() as hellgroup by rowwhere ???and now i forgot what to put into it so i can select the value which has the highest row "hell" which is made up abovewhile earth still spininglive on, have funelsemove to mars |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-04 : 13:56:31
|
select * from(selectcol1,col2,row_count() over (partition by col2 order by col1 desc) as hellfrom tablewhere col2 = 'yxz')dtwhere hell = 1 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-09-04 : 14:00:54
|
webfred..did you mean quote:
select * from(selectcol1,col2,row_number() over (partition by col2 order by col1 desc) as hellfrom tablewhere col2 = 'yxz')dtwhere hell = 1
|
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-04 : 14:04:57
|
quote: Originally posted by vijayisonly webfred..did you mean quote:
select * from(selectcol1,col2,row_number() over (partition by col2 order by col1 desc) as hellfrom tablewhere col2 = 'yxz')dtwhere hell = 1
Oh yes!I'm an old man and this has been a hard week GOOD CATCH! No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|