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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-29 : 07:28:01
|
| Kalpan writes "i want sequential data as below can anybody helpselect dateofservice,tblsortorder.orroomno from tblcasedata , tblsortorderwhere tblcasedata.orroomno= tblsortorder.orroomno and dateofservice >= '8/25/2005' and dateofservice <= '8/27/2005' group by dateofservice ,tblsortorder.orroomnosequence number which i have shown is not in the database but i want like this.output wanted :- orroomno dateof service sequenceno1 8/26/2005 11 8/26/2005 22 8/26/2005 13 8/26/2005 13 8/26/2005 23 8/26/2005 3" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 07:34:07
|
| I think it is not possible until you have primary keyIf you have primary key thenSelect orroomno,dateof_service,(select count(*) from yourTable where orroomno=T.orroomnoand dateof_service=T.dateof_service and PrimaryKey<=T.PrimaryKey) from yourTable TMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|