一.mysql查询的五种子句where(条件查询).having(筛选).group by(分组).order by(排序).limit(限制结果数) 二.子查询1.where 子查询SELECT * FROM tb1 WHERE cat_id IN (SELECT max(id) FROM tb2 GROUP BY cat_id); 2.from 子查询SELECT t2_id FROM (SELECT t2_id FROM tb2 ORDER BY t2_id DESC); 3.exists