子查询
利用子查询进行过滤
select * from table where order_id in (2005,2007);
select cust_name,cust_state,(select count(*) from orders where orders.cust_id = customers.cust_id) as orders from
customers order by cust_name
上述语句什么意思呢?
根据cust_name排序,然后查看出每个cust_id在order出现了多少次,以及名称等信息