摘要:
书写顺序: select -> from -> where -> group by -> having -> order by 执行顺序: from -> where -> group by -> having -> select -> order by 阅读全文
摘要:
1. 普遍方法: 使用 COUNT(*) ,例如: 缺点: 记录集还需要单独的查询来获取,相当于两次查询 2. 推荐方法 虽然看起来是两条SQL语句,但是实际上只执行了一次数据库查询。 阅读全文