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)
 inner join

Author  Topic 

nishithrn
Yak Posting Veteran

58 Posts

Posted - 2003-11-07 : 04:20:34
Hello,
I have a table which is something like this:
dbdate dbname dbsize

04/03/2003 AEXCISE0203 18.5
11/03/2003 AEXCISE0203 18.5
18/03/2003 AEXCISE0203 19.81
25/03/2003 AEXCISE0203 19.81
01/04/2003 AEXCISE0203 19.81
08/04/2003 AEXCISE0203 19.81
15/04/2003 AEXCISE0203 19.81
22/04/2003 AEXCISE0203 19.81
29/04/2003 AEXCISE0203 19.81
04/05/2003 AEXCISE0203 19.81
11/05/2003 AEXCISE0203 19.81
18/05/2003 AEXCISE0203 19.81
29/04/2003 AEXCISE0304 27.63
04/05/2003 AEXCISE0304 28.94
11/05/2003 AEXCISE0304 28.94
18/05/2003 AEXCISE0304 28.94
29/04/2003 AURANGABADBACKUP 27.63
04/05/2003 AURANGABADBACKUP 27.63
11/05/2003 AURANGABADBACKUP 27.63
18/05/2003 AURANGABADBACKUP 27.63

I would like to create a query wherein I get an output like this:
dbdate AEXCISE0203 AEXCISE0304 AURANGABADBACKUP
04/03/2003 18.5
11/03/2003 18.5
18/03/2003 19.81
25/03/2003 19.81
01/04/2003 19.81
08/04/2003 19.81
15/04/2003 19.81
22/04/2003 19.81
29/04/2003 19.81 27.63 27.63
04/05/2003 19.81 28.94 27.63
11/05/2003 19.81 28.94 27.63
18/05/2003 19.81 28.94 27.63


I gues INNER JOIN would help, but I have not been successful.
Any suggestions....?????
Thanks in Advance
Nishith

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-11-07 : 06:14:53
Hi

Looks like you need a crosstab

http://www.sqlteam.com/item.asp?ItemID=2955



Damian
Go to Top of Page
   

- Advertisement -