如果有三张表orders(包含order_id、customer_id、product_id)、customers(包含c...
如果有三张表orders(包含order_id、customer_id、product_id)、customers(包含customer_id、customer_name)和products(包含product_id、product_name),查询每个订单的订单号、客户姓名和产品名称。**** Hidden Message *****
SELECT o.order_id, c.customer_name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id; orders.customer_id=customers.customer_idjoin orders.product_id = products.product_id SELECT o.order_id, c.customer_name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id; SELECT o.order_id, c.customer_name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id; SELECT o.order_id, c.customer_name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id; SELECT o.order_id, c.customer_name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id;
页:
[1]