MENU

in的用法

June 4, 2018 • Read: 2648 • 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
Last Modified: August 27, 2018
Archives Tip
QR Code for this page
Tipping QR Code
Leave a Comment