随笔分类 - MySQL
摘要:explain显示了mysql如何使用索引来处理select语句以及连接表。可以帮助选择更好的索引和写出更优化的查询语句。 使用方法,在select语句前加上explain就可以了: 如: explain select surname,first_name form a,b where a.id=b
阅读全文
posted @ 2019-08-14 09:38
码痴
摘要:exists : 强调的是是否返回结果集,不要求知道返回什么, 比如: select name from student where sex = 'm' and mark exists(select 1 from grade where ...) ,只要exists引导的子句有结果集返回,那么exi
阅读全文
posted @ 2018-12-20 10:04
码痴