MENU

between的用法

June 3, 2018 • Read: 141 • SQL

between【在某个范围】
--查找工资在a到b之间(包括a,b)的所有员工的信息
select * from emp
    where sal >= 1500 and sal <= 3000
--等价于
select * from emp
    where sal between 1500 and 3000
--查找工资在小于或大于之间的所有员工的信息
select * from emp
    where sal < 1500 and sal > 3000
--等价于
select * from emp
    where sal not between 1500 and 3000
最后编辑于: August 27, 2018
Archives Tip
QR Code for this page
Tipping QR Code
Leave a Comment