select id,name from os_customer where id in (12,13,14)
select id,name from os_customer where id not in (12,13,14,15,16)
select id, name from os_customer where id between 0 and 12
select id, name from os_customer where id not between 0 and 12
select id, name from os_customer where name like "%局%"
select id, name from os_customer where name like "%电_%"
select id, name, update_time from os_customer where update_time is null
select id, name, update_time from os_customer where update_time is not null
select id,name,create_time from os_customer order by create_time desc
select id,name,create_time from os_customer order by create_time
select id ,name,count(1) from sys_user where name like "%家%华%" group by name
select id ,name,create_time from sys_user where name like "%家%华%" group by name,create_time
select id, name from os_customer group by name having count(name) >1
select name from sys_user where name like "%家%华%" group by name with rollup
select * from sys_user limit 4
select * from os_customer oc inner join os_customer_user ocu on oc.id = ocu.id
select * from os_customer oc, os_customer_user ocu where oc.id = ocu.id
select * from os_customer oc left join os_customer_user ocu on oc.id = ocu.id
select * from os_customer oc right join os_customer_user ocu on oc.id = ocu.id
select * from os_customer oc where oc.id > any(select user_id from os_customer_user)
select * from os_customer oc where oc.id > all(select id from os_customer_user)
select * from os_customer oc where exists(select id from os_customer_user where id = 2)
select id from os_customer_user where id = 2 这条数据可以查询出数据,因此可以查询到数据
select * from os_customer oc where exists(select id from os_customer_user where id = 52)
select id from os_customer_user where id = 52 这条语句查询不到数据,因此最后查询不到数据
select * from os_customer oc where not exists(select id from os_customer_user where id = 50)
select id from os_customer_user where id = 50 这条查询语句是没有数据的,因此最终的查询可以查到数据
select * from os_customer oc where not exists(select id from os_customer_user where id = 5)
select id from os_customer_user where id = 5 这条查询语句是有数据的,因此最终的查询查不到数据
select * from os_customer oc where id in (select user_id from os_customer_user )
select * from os_customer oc where id not in (select user_id from os_customer_user)
select * from os_customer oc where id >= 36
select id,name from os_customer where id >45 union select id,name from os_customer where id in (48,49)
select id,name from os_customer where id >45 union all select id,name from os_customer where id in (48,49)