Click here to Skip to main content
15,896,207 members

inner join query problem

Revision 4
i have three tables 1. member_commission 2. member_payment 3. member_detail
now i want to join all three tables to get common deatil..my query is..

SQL
select r.ref_id,sum(r.ref_com),m.mname,p.bal_amt from member_commission  as r inner join member_detail as m
on r.ref_id=m.mem_id inner join member_payment  as p on r.ref_id=p.mem_id where r.pay_check='unpaid' group by r.ref_id


to get total commission earn by all different members,their id and their name and finally last unpaid balance
the details are coming from all these three tables but my query is not working;it throws error on mname

please give me some exactly idea to fetch detail from three tables
Posted 16-Nov-12 21:11pm by Miss Maheshwari.