Extracting Multiple rows as columns of single row
Posted: Tue May 01, 2018 6:43 am
I have 2 Tables like below and trying to extract 1 record per account by joining 2 tables. I retrieved as multiple rows, but would like to extract as 1 record
Table1
Table2
Expected Result
Is it possible to extract in single query. I tried CASE WHEN but couldn't figure it out
Use the code tags when presenting data. Coded for you this time.
Table1
ID ACCT PROD ID
1 1234 P1
1 1234 P3
1 1234 P1
1 1234 P3
Table2
Prod ID Prod Name
P1 Product 1
P2 Product 2
P3 Product 3
P1 Product 1
P2 Product 2
P3 Product 3
Expected Result
1234, Product 1, Product 3
Is it possible to extract in single query. I tried CASE WHEN but couldn't figure it out
Use the code tags when presenting data. Coded for you this time.