【发布时间】:2022-11-23 10:50:19
【问题描述】:
select o.*,x.cust_name from(
select cust_name from customer c where salesman_id IN(
select salesman_id from Orders o where ord_date ='2012-08-17'))x
我只有客户名称,但我还需要订单列。我想在子查询中解决
| ord_no | purh_amt | ord_date | cust_id | salesman_id | cust_name |
|---|---|---|---|---|---|
| 70011 | 75.29 | 2012-08-17 | 3003 | 5007 | jozy |
| 7004 | 110.5 | 2012-08-17 | 3009 | 5003 | geoff |
【问题讨论】:
标签: sql sql-server-2005