子查询

  1. select order_num from orderitems where prod_id = 'TNT2'
    结果: order_num
    20005
    20006

  2. select cust_id from orders where order_num in (20005,2007)

  3. select cust_id from orders where order_num in (select order_num from orderitems where prod_id = 'TNT2')

posted @ 2024-05-29 10:36  肥梁  阅读(12)  评论(0)    收藏  举报