Add Birthday
join query for get the records in below format , I tried the first query was fine but I m unable to get the second result uing first query.please reply if u know the answer
4 replies to this topic
Laxman B
#1
|
Member
26
Points
|
Posted on
13 Jul 2012 10:50 AM IST
Table1 Table2
PID ProductDesc ProductCode Date PID
1 Packet-Eye P001 1/14/2009 1
2 Wiggy W099 1/15/2009 1
3 Wimax-Lite W001 2/1/2009 2
4 Wimax-Home W002 3/3/2009 3
… … … … …
… … … … …
The table1 contains 20 rows and the table2 contains 800,000 rows.
Output 1
------------
Registration Date Product Description
1-Jan-09 Wimax-Lite
12-Jan-09 Wimax-Lite
14-Feb-09 Wimax-Home
3-Mar-09 Packet-Eye
… …
… …
Query2
Output 2
Product Jan 2009 Feb 2009 Mar 2009 Apr 2009 May 2009 Jun 2009 Jul 2009
Packet-Eye 45 67 23 54 12 44 6
Wiggy 0 0 0 20 600 788 1000
Wimax-Lite 300 100 150 110 150 200 400
Wimax-Home 200 300 500 300 400 400 500
… … … … … … … …
… … … … … … … …
Using Table1 and Table2, construct 2 separate SQL scripts to derive the output illustrated by Output 1 and Output 2.
|
SQL Server
1770
views
Reply to this topic
|
Laxman B
#2
|
Member
26
Points
|
Replied on
13 Jul 2012 10:52 AM IST
Table1 Table2
PID ProductDesc ProductCode Date PID
1 Packet-Eye P001 1/14/2009 1
2 Wiggy W099 1/15/2009 1
3 Wimax-Lite W001 2/1/2009 2
4 Wimax-Home W002 3/3/2009 3
… … … … …
… … … … …
The table1 contains 20 rows and the table2 contains 800,000 rows.
Output 1
------------
Registration Date Product Description
1-Jan-09 Wimax-Lite
12-Jan-09 Wimax-Lite
14-Feb-09 Wimax-Home
3-Mar-09 Packet-Eye
… …
… …
Query2
Output 2
Product Jan 2009 Feb 2009 Mar 2009 Apr 2009 May 2009 Jun 2009 Jul 2009
Packet-Eye 45 67 23 54 12 44 6
Wiggy 0 0 0 20 600 788 1000
Wimax-Lite 300 100 150 110 150 200 400
Wimax-Home 200 300 500 300 400 400 500
… … … … … … … …
… … … … … … … …
Using Table1 and Table2, construct 2 separate SQL scripts to derive the output illustrated by Output 1 and Output 2.
|
Reply to this topic
|
Laxman B
#3
|
Member
26
Points
|
Replied on
13 Jul 2012 10:53 AM IST
Table1 Table2
PID ProductDesc ProductCode Date PID
1 Packet-Eye P001 1/14/2009 1
2 Wiggy W099 1/15/2009 1
3 Wimax-Lite W001 2/1/2009 2
4 Wimax-Home W002 3/3/2009 3
… … … … …
… … … … …
The table1 contains 20 rows and the table2 contains 800,000 rows.
Output 1
------------
Registration Date Product Description
1-Jan-09 Wimax-Lite
12-Jan-09 Wimax-Lite
14-Feb-09 Wimax-Home
3-Mar-09 Packet-Eye
… …
… …
Query2
Output 2
Product Jan 2009 Feb 2009 Mar 2009 Apr 2009 May 2009 Jun 2009 Jul 2009
Packet-Eye 45 67 23 54 12 44 6
Wiggy 0 0 0 20 600 788 1000
Wimax-Lite 300 100 150 110 150 200 400
Wimax-Home 200 300 500 300 400 400 500
… … … … … … … …
… … … … … … … …
Using Table1 and Table2, construct 2 separate SQL scripts to derive the output illustrated by Output 1 and Output 2.
|
Reply to this topic
|
Laxman B
#4
|
Member
42
Points
|
Replied on
22 Sep 2014 01:31 PM IST
Hi frds,
I find this answer.
|
Reply to this topic
|
Laxman B
#5
|
Member
42
Points
|
Replied on
22 Sep 2014 01:31 PM IST
Hi frds,
I find this answer.
|
Reply to this topic
|
|
|