测试积点老人 发表于 2024-11-7 09:49:34

有两个表orders(包含order_id、customer_id、order_date)和customers(包含custo...

有两个表orders(包含order_id、customer_id、order_date)和customers(包含customer_id、customer_name),如何查询每个订单的订单号、客户姓名和订单日期?
**** Hidden Message *****

kallinr 发表于 2024-11-8 09:18:26

SELECT o.order_id, c.customer_name, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

oliver.tang 发表于 2024-11-8 09:20:05

select A.order_id, B.customer_name,A.order_date from orders A left join customers B on A.customer_id = B.customer_id

海海豚 发表于 2024-11-8 10:54:21

SELECT o.order_id, c.customer_name, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

jingzizx 发表于 2024-11-8 11:30:48

SELECT o.order_id, c.customer_name, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

你好浮戈 发表于 2024-11-8 13:15:30

SELECT o.order_id, c.customer_name, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

litingting0214 发表于 2024-11-8 13:54:17

SELECT o.order_id, c.customer_name, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;
页: [1]
查看完整版本: 有两个表orders(包含order_id、customer_id、order_date)和customers(包含custo...