多表删除 table
delete a,b from a_table a LEFT JOIN b_table b on a.a_id=b.b_id;select
多表更新 统计
UPDATE a_table a,b_table b SET b.b_part="12dd13",a.a_name="老刘1ds" where a.a_id=b.b_id and b.b_id=5查询
分组查询并统计次数大于0tab
select b.b_name,count(*) as count from b_table b GROUP BY b.b_name HAVING count>0;vi
用having就必定要和group by连用, 用group by不一有having (它只是一个筛选条件用的)