普通查询:
select t1.name,t1.age from table1 t1 where t1.sid in ( select t2.id from table2 t2 where t2.yahei='嘿嘿'
)
优化后sql
select t1.name,t1.age from table1 t1 where t1.sid in ( select t21d from ( select t2.id as t21d from table2 t2 where t2.yahei='嘿嘿' ) as t21d )