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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SELECT AND WEEKS

Author  Topic 

DENIZ3E
Yak Posting Veteran

56 Posts

Posted - 2005-11-24 : 01:47:25
Hý,
I have got a table
table
-------------------
ID card
--- -----
1 A
2 B
3 C
4 D

I WANT TO FOLLOW ROWS. AND IN THIS ANSWER SELECT QUERY
CARD WEEK
----- ----
A 1
A 2
A 3
A 4
.. ..
A 53
B 1
B 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..
Go to Top of Page

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 int
set @n=1

While @n<=53
Begin
Insert into @Number values(@n)
set @n=@n+1
End

select T1.Card,T2.num as [WEEK] from @t T1 cross join @Number T2 order by T1.Card


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -