两表联查 先联查好还是先where好

 

 第一个是先过滤,子集与另一子集相关联

SELECT a.TT_ID,A.TT_TAG,b.* FROM

(SELECT * FROM New_TopicTag WHERE TT_Tag=维修)as a

INNER JOIN New_Topic as b ON a.Tpc_ID = b.Tpc_ID

 

 

第二个是先关联。再过滤。

SELECT a.TT_ID,A.TT_TAG,b.* FROM New_TopicTag AS A

INNER JOIN New_Topic as b ON a.Tpc_ID = b.Tpc_ID

where a.TT_Tag=维修

 

两表联查 先联查好还是先where好

上一篇:WAL writer process(预写式日志写)


下一篇:HashMap(JDK8) 源码分析及夺命9连问