摘要: Mysql 聚合函数嵌套使用 目的:Mysql 聚合函数嵌套使用 聚合函数不可以直接嵌套使用,比如: max(count(*)) 思路:但是可以嵌套子查询使用(先分组取出count值, 再将count值倒序排列,取第一个值就是最大的) select max(total) from ( select 阅读全文
posted @ 2020-06-17 09:57 惊鸿难定 阅读(836) 评论(0) 推荐(0) 编辑
摘要: 如果sql语句中的子查询包含limit 例如: select * from table where id in (select id from table limit 3) 会报错: This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ 阅读全文
posted @ 2020-06-17 09:28 惊鸿难定 阅读(1392) 评论(0) 推荐(0) 编辑
摘要: 在上一文中发布了多表删除指定记录,发现达不到我想要的效果,找了很多资料,发现以下方法。 数据库不能边查询边删除, 尝试以下操作 delete from push_msg_overview where id in ( select id from push_msg_overview where pus 阅读全文
posted @ 2020-06-17 09:07 惊鸿难定 阅读(1110) 评论(0) 推荐(0) 编辑