select date,c.name as client,amount,pm.name as pay_method from payments p
left join clients c using(client_id) -- 使用using替换 on c.client_id = p.client_id
left join payment_methods pm on pm.payment_method_id = p.payment_method;
-- using只能使用在不同表中有相同字段的场景
感谢各位读者查阅,欢迎各位👍点赞?评论?收藏+关注!