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 |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-04-11 : 06:16:17
|
| Good morning.I have a basic table create table IndividualTotals (count int null )Count343533411993Now is there a way i can select row 2 or 3 with out having to insertan identity column. This table changes throughout the day and is referenced in an excel sheet to populate a fancy report. people just wont move away from excel.MCTS / MCITP certified |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2011-04-11 : 06:20:41
|
How you are deciding 2nd and 3rd row ?On the basis of order by which column ?anyways try this - SELECT Count, ROW_NUMBER OVER( ORDER BY ( SELECT 1 ) ) Seq FROM IndividualTotals Vaibhav TIf I cant go back, I want to go fast... |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-04-11 : 06:36:57
|
| thank youI am trying to get the first value in the sequence with the following code.SELECT [count], ROW_NUMBER() OVER( ORDER BY ( SELECT 1 ) ) seq FROM IndividualTotalswhere seq = 1but i am receiving the following message.Msg 207, Level 16, State 1, Line 4Invalid column name 'seq'. |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-04-11 : 07:01:47
|
| Its ok. Ive sorted it thank you for you quick reply Vaibhav TNice one |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2011-04-11 : 09:28:18
|
You are welcomeVaibhav TIf I cant go back, I want to go fast... |
 |
|
|
|
|
|