mysql使用sum()出现null的问题,各种总结
今天进行sql查询时,碰到了一个问题:
SQL语句:
select r.user_id, r.job_id, sum(t.money) as job_salary from pj_punch_records as r left join pj_punch_transactions as t on r.job_id = t.transaction_detail where r.user_id = 1 and t.type = 1 order by r.created_at desc
1.进行2表关联查询,同时
原创
2020-07-27 11:47:08 ·
1795 阅读 ·
0 评论