Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hý,I have got a tabletable-------------------ID card --- -----1 A2 B3 C4 DI WANT TO FOLLOW ROWS. AND IN THIS ANSWER SELECT QUERYCARD WEEK----- ----A 1A 2 A 3 A 4.. ..A 53B 1B 2.. ..B 53
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts
Posted - 2005-11-24 : 02:17:18
well what is the week???? and is this linked to some other table.. and you want to fetch the records from 2 tables???Sucess Comes to those who Believe in Beauty of their Dream..
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2005-11-24 : 02:19:05
Not sure if it is feasible
Declare @t table(id int, card char(1))insert into @t select 1,'A' union all select 2,'B' Declare @Number table(num int)Declare @n intset @n=1While @n<=53Begin Insert into @Number values(@n) set @n=@n+1Endselect T1.Card,T2.num as [WEEK] from @t T1 cross join @Number T2 order by T1.Card