8

mysql 子查询 和 left join 执行顺序

 2 years ago
source link: https://www.v2ex.com/t/849384
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

mysql 子查询 和 left join 执行顺序

  awanganddong · 5 小时 35 分钟前 · 258 次点击

sql 语句中包含子查询和连表查询 所以想知道这两个的执行先后顺序 或者哪里有相关文档介绍

liprais      5 小时 29 分钟前

看 explain 不就知道了

awanganddong      5 小时 23 分钟前

id
每个单位查询的 SELECT 语句都会自动分配的一个唯一标识符,表示查询中操作表的顺序,有四种情况:

id 相同:执行顺序由上到下
id 不同:如果是子查询,id 号会自增,id 越大,优先级越高。
id 相同的不同的同时存在
id 列为 null 的就表示这是一个结果集,不需要使用它来进行查询。
————————————————


@liprais 是看这一项吧

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK