多表查询

sql | 2017-10-09 21:58:29 | 50次阅读 | 0评
select u.name_id,u.phone,u.username,sum(i.inmoney)-sum(o.outmoney) as balance
from  users  u  inner join  table_in i on u.name_id=i.name_id join table_out o on  u.name_id=o.name_id 
group by o.name_id,i.name_id ;
博友评论,共0条
浏览143389次