请问一下,那个sql比较快
马前小卒 2004-12-21 01:39:59 请问一下,下列2个sql,那个比较快
1>
select * from table1,table2 where table1.id=table2.id and substr(table2.code,1,3)='001'
2>
select * from table1 where table1.id in (select id from table2 where substr(code,1,3)='001')
其中:
substr(table2.code,1,3)='001',中的'001'是不变的常量
table2的数据在100左右
table1的数据在8千条左右
顺便问以下,是否有工具可以判断sql的效率