摘要: 銷售員 select s.`name` from salesperson s left join orders o on s.sales_id=o.sales_id left join company c on o.com_id=c.com_id and c.name='RED' group by 阅读全文
posted @ 2023-04-25 17:19 Carl_ZhangJH 阅读(13) 评论(0) 推荐(0)
摘要: 大的國家 select `name`, population, area from World where area >= 3000000 or population >= 25000000 阅读全文
posted @ 2023-04-25 15:55 Carl_ZhangJH 阅读(12) 评论(0) 推荐(0)
摘要: 訂單最多的客戶 select customer_number from Orders group by customer_number having count(order_number) = ( select count(order_number) from Orders group by cus 阅读全文
posted @ 2023-04-25 15:36 Carl_ZhangJH 阅读(13) 评论(0) 推荐(0)
摘要: 尋找用戶推薦人 select name from customer where referee_id <> 2 or referee_id is null 阅读全文
posted @ 2023-04-25 15:12 Carl_ZhangJH 阅读(14) 评论(0) 推荐(0)
摘要: 至少有5名直接下屬的經理 子查詢 select `name` from Employee where id in ( select managerId from Employee group by managerId having count(managerId) >= 5 ) 自連接 select 阅读全文
posted @ 2023-04-25 14:29 Carl_ZhangJH 阅读(17) 评论(0) 推荐(0)