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

MENU

between的用法

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