今日成果:
SELECT
payment_id,
c.name,
p.date,
p.amount,
p.invoice_id,
pm.name AS pay_name
FROM
payments p
JOIN
clients c ON p.client_id = c.client_id
JOIN
payment_methods pm ON p.payment_method = pm.payment_method_id;
-- 多表连接
select *
from order_items oi
join order_item_notes oin
on oi.order_id = oin.order_id
and oi.product_id = oin.product_id;
-- 复合连接条件:多个字段决定一条记录
感谢各位读者查阅,欢迎各位👍点赞✍评论⭐收藏+关注!