- This operator is used to display rows based on a range of values.
- The declared range is inclusive. The lower limit should be declared first.
- The range that you specify contains a lower limit and an upper limit.
Examples
:-
Select
ename, sal, job from emp where
sal BETWEEN 1000 AND 2000;
Select ename, sal, job from emp where sal NOT
BETWEEN 1000 AND 2000;
Select ename, sal, job from emp where job BETWEEN ‘MANAGER’
AND ‘SALESMAN’;
Select ename, sal, job from emp where job NOT BETWEEN
‘MANAGER’ AND ‘SALESMAN’;
Select ename, sal, job, hiredate from emp where hiredate
BETWEEN ’02-APR-81’ AND ’12-JAN-83’;
Select ename, sal, job, hiredate from emp where hiredate
NOT BETWEEN ’02-APR-81’ AND ’12-JAN-83’;
No comments:
Post a Comment