i have a sample data like this :
trancation-A
=========================
date price
=========================
2014-08-16 50000
2014-08-17 60000
2014-08-16 60000
trancation-B
=========================
date price
=========================
2014-08-16 75000
2014-08-17 90000
2014-08-18 70000
when parameter date='2014-08-16'
and i want this result like this :
=================================
totalA priceA totalB priceB
=================================
2 Unit 110000 1 Unit 75000
i run my query :
select count(A.price)as totalA, sum(A.price)as priceA,
count(B.price)as totalB, sum(B.price)as priceB
from t_penjualan as A join t_pembelian as B
where A.tgl_transaksi = '2014-08-16' and B.tgl_transaksi = '2014-08-16'
still wrong... please help me....