mysql or in union all 使用方法

or的用法

select * from bt where bt.ID =98 or bt.ID = 1222 or bt.ID = 8903;

in 的用法

select * from bt where bt.ID in (98 ,1222 ,8903);

union all 的用法

select * from bt where bt.ID=98 
union all 
select * from bt where bt.ID=1222 
union all 
select * from bt where bt.ID=8903;

猜你喜欢

转载自www.cnblogs.com/gylhaut/p/9212199.html