56,687
社区成员
发帖
与我相关
我的任务
分享
select * from tt_user
where tt_id!=(select gg_id from tt_group)
and tt_check<(select cc_id from tt_config)
查询结果:
-----------------------
tt_id tt_name tt_check
1 a 1
4 d 1
-----------------------
测试数据如下
tt_user,tt_group,tt_config
tt_user:
tt_id tt_name tt_check
1 a 1
2 b 4
3 c 1
4 d 1
tt_group:
gg_id
3
tt_config
cc_id
4
查询条件为: 从tt_user中查询去 tt_id!=tt_group.gg_id 并且 tt_check <tt_config.cc_id