October 5, 2007 at 12:25 am
Hi everyone
I have two table
Table1
id date
101 10/01/2007
102 10/04/2007
103 10/05/2007
104 10/06/2007
Table 2
id Plan
101 A
101 B
102 A
102 B
102 C
102 D
103 C
103 D
104 A
i need a query to display the following result
id date A B C D
101 10/01/2007 Y Y N N
102 10/04/2007 Y Y Y Y
103 10/05/2007 N N Y Y
104 10/06/2007 Y N N N
thanks in advance
regards
sthanika
October 5, 2007 at 12:35 am
Hi
I think u can use the pivot operator for this. search this other sites for how to use pivot.
"Keep Trying"
October 5, 2007 at 1:07 am
It's not nice to cross post 😉
[highlight]http://www.sqlservercentral.com/Forums/Topic407185-338-1.aspx[/highlight]
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply