内部联接查询问题 [英] inner join query problem

查看:84
本文介绍了内部联接查询问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个表1. member_commission 2. member_payment 3. member_detail
现在我想将所有三个表连接起来以获取通用的数据..我的查询是..

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..

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



以获取所有不同成员的总佣金,他们的ID和姓名以及最后的未付余额
详细信息来自所有这三个表,但我的查询无法正常运行,
mname上有一些错误

请给我一些确切的想法,如何从三个表中获取详细信息...



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,
there are some error on mname

please give me some exactly idea how to fetch details from three tables ...

推荐答案

详细了解表


这篇关于内部联接查询问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆