Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have two tables like Below..

Accounts - Table1
AccID   AccType
  1       A
  2       B
  3       C



Transactions - Table2
TrID	TrTo_AccID	TrAmount
100  	  1	         1000
100	  2	         2000
101	  1	         3000
101	  2	         4000
101 	  3	         5000



Now i need to get output like below..
TrID	A_Tr	B_Tr	C_Tr
100	1000	2000	null
101	3000	4000	5000


How can i write Mysql query to get this output.. Please help..

Thanks in advance...
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900