select
tr.id,ftd.currency as USD sum(ftd.amount) as AMTUSD,'' as CAD,'' as AMTCAD,
ft.Currency as CUsd,ft.amount as AUSD,''as Ccad,''as Acad
from
finaltable as ft,
final_table_details as ftd,
table_results as tr,
table as t
where
tr.id=t.id and
tr.datetime=ftd.datetime and
tr.id=ftd.t_id and
ftd.t_id=ft.t_id and
ftd.t_date=ft.t_date
group by
tr.id,tr.datetime,t.name,ftd.currency,ft.currency, ft.amount.
After some programming,I am getting results as :
ID USD AMTUSD CAD AMTCAD CUSD AUSD CCAD ACAD
1 USD 10 USD 100
1 CAD 20 CAD 200
I want that if ID is same,results should be like:
ID USD AMTUSD CAD AMTCAD CUSD AUSD CCAD ACAD
1 USD 10 CAD 20 USD 100 CAD 200
Can you please help me now??