MENU

between的用法

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