2019独角兽企业重金招聘Python工程师标准>>>
SELECT t1.field1,t1.field2,t1.field3 from t1 where t1.pid in (select fid from t2 where t2.ch='%123456%')
再看这段代码,
select t.* from mefinance.me_customer_info t where t.id in (3285,4241,4243,4245,4251,4253,4257,4259,4261,4263,4267)
第二条sql语句,是按照指定的id到表中进行查询 是批量的id ,这样可以大大缩短查询时间,而且指定的ID
是可以换成一个动态的sql语句的。如第一条sql语句
这种查询方法要比查询多表,在进行多表的条件限制查询速度快上很多