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 |
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-06-10 : 02:58:13
|
| here is the querySET NOCOUNT ONCREATE TABLE #RowNumber (RowNumber int IDENTITY (1, 1),StuEnterID INT)INSERT #RowNumber (StuEnterID)SELECT StuEnterIDFROM dbo.WStudy SWHERE StuEnterID = '50484' SELECT RowNumber, S.StuID, S.StuTitle, S.StuEnterIDFROM #RowNumber R JOIN dbo.WStudy SON r.StuEnterID = s.StuEnterIDORDER BY RowNumberDROP TABLE #RowNumberSET NOCOUNT OFFit does add row number to table HOWEVER it looks like this1 1085 eeee 504841 1086 dddd 504842 1085 eeee 504842 1086 dddd 504843 1088 eeeeee 504843 1089 s 50484AND i WANT IT TO LOOK LIKE THIS1 1085 eeee 504842 1085 eeee 504843 1088 eeeeee 50484any help would be greatly appreciated |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-06-10 : 03:40:00
|
This maybe?INSERT #RowNumber (StuEnterID)SELECT StuEnterIDFROM dbo.WStudy SWHERE StuEnterID = '50484' ORDER BY S.StuID, S.StuTitle, S.StuEnterID Kristen |
 |
|
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-06-10 : 03:52:06
|
actually i figured it out...it isINSERT INTO #RowNumber (StuEnterID)quote: Originally posted by Kristen This maybe?INSERT #RowNumber (StuEnterID)SELECT StuEnterIDFROM dbo.WStudy SWHERE StuEnterID = '50484' ORDER BY S.StuID, S.StuTitle, S.StuEnterID Kristen
|
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-06-10 : 06:34:33
|
Its is? Well if that's the only change that's needed I'm a Chinaman ... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-11 : 09:11:19
|
| 1 where do you want to show data? If you use front end application, you can easily do numbering there2 Kristen's query will work fine as wellMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|