Hello guys,
kindly please help me with my problems that im having it for abt 1 week, and i can;t solve it.
Im using MySQL 4.0.21 and I have 2 tables :
[payment] [cashier]
id id
amtpay stockid
subtot
[payment].id is correlated to [cashier].id
for examples i have 2 records in cashier, and 3 records in payment.
and i want to make a join table, but im failed
the errors goes like this "Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select select id, sum(subtot) as subtot from cashier group by id) as A inner join"
Here's i quot my full syntax:
Thanks
kindly please help me with my problems that im having it for abt 1 week, and i can;t solve it.
Im using MySQL 4.0.21 and I have 2 tables :
[payment] [cashier]
id id
amtpay stockid
subtot
[payment].id is correlated to [cashier].id
for examples i have 2 records in cashier, and 3 records in payment.
and i want to make a join table, but im failed
the errors goes like this "Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select select id, sum(subtot) as subtot from cashier group by id) as A inner join"
Here's i quot my full syntax:
Code:
select A.id , A.subtot, B.amtpay
from (select id, sum(subtot) as subtot from cashier group by id) as A inner join
(select id, sum(amtpay) as amtpay from payment group by id ) as B
A.id = B.id;
Thanks