查询出user表中有user_pro中没有的mobile字段
select * from user where mobile not in(select mobile from user_pro)
SELECT u.* FROM user u WHERE NOT EXISTS (SELECT 1 FROM user_pro up WHERE u.mobile = up.mobile)
要是查询user_pro中有user中没有则只需要换一下表名即可。
写法一,查询时间0.437秒,写法二查询时间3.93秒,也有数据量的关系各位看着取舍
这个是我自己业务需要写的查询语句记录一下
关联表条件查询出consumer与consumer_pro表中不同的字段(consumer中有consumer_pro中没有),answer_sheet则是关联条件查询
select sc.* from consumer sc left join answer_sheet a on sc.openid=a.user_id where openid not in(select openid from consumer_pro) AND a.survey_id='c0400a9001d24469b1cec165bf621a41';
查询出user表中有user_pro中没有的mobile字段写法一select * from user where mobile not in(select mobile from user_pro)写法二SELECT u.* FROM user u WHERE NOT EXISTS (SELECT 1 FROM user_pro up WHERE u.mobile = up.mobile)要是查询user_pro中有user中没有则只需要换一下表名即可。写法一,查询时间0.43
Unrecognized token ‘xx‘: was expecting (JSON String, Number, Array, Object or token ‘null‘, ‘true‘..
24214