第一次查询:
SELECT orders.order_id,account.username
FROM account
LEFT JOIN orders ON orders.account_id=account.account_id
第二次查询:
SELECT items.item_name
FROM order_items
LEFT JOIN items ON items.item_id=order_items.item_id
答案 0 :(得分:0)
试试这个
SELECT
orders.order_id,
account.username,
items.item_name
FROM account
LEFT JOIN orders ON orders.account_id=account.account_id
LEFT JOIN order_items ON orders.order_id = order_items.order_id
LEFT JOIN items ON items.item_id=order_items.item_id
答案 1 :(得分:0)
试试这个
SELECT orders.order_id,account.username, items.item_name
FROM account
LEFT JOIN orders on orders.account_id=account.account_id
left join order_items ON orders.order_id = order_items.order_id
left join items on items.item_id=order_items.item_id