各位如果看到博客内有广告,可以动手点一点,谢谢

MENU

in的用法

June 4, 2018 • Read: 308 • SQL

in【属于若干个孤立的值】
select * from emp
    where sal in (1500,3000,5000)
--等价于
select * from emp
    where sal = 1500 or sal = 3000 or sal = 5000
select * form emp
    where sal not in (1500,3000,5000)
--等价于
select * from emp
    where sal <> 1500 and sal <> 3000 and sal <> 5000
Archives Tip
QR Code for this page
Tipping QR Code
Leave a Comment