By admin | January 25, 2008

Between, In Operators in SQL

This lesson will describe the usage of IN, Between Operators in Oracle

At times usage of OR, AND becomes cumbersome. Oracle has facilitated some other operators

BETWEEN

SELECT ENAME,JOB,SAL FROM EMP

WHERE SAL BETWEEN 1500 AND 3000;

is exactly equivalent to

SELECT ENAME,JOB,SAL FROM EMP

WHERE SAL> 1500 AND SAL < 3000;

Between can replace complicated AND operators

IN

SELECT EMPNO,ENAME,JOB,DEPTNO FROM EMP

WHERE JOB IN (‘PRESIDENT’,’MANAGER’,’ANALYST’);
 

This is exactly equivalent to

SELECT EMPNO,ENAME,JOB,DEPTNO FROM EMP

WHERE JOB =‘PRESIDENT’ OR JO’MANAGER’,’ANALYST’;

IN can replace complicated OR operators

Digg Facebook Technorati Bloglines

Email This Post Email This Post
Topics: Database |



Leave a Comment

Name:

E-Mail :

Website :

Comments :

Ad

Calendar

November 2008
M T W T F S S
« Oct «-»  
 12
3456789
10111213141516
17181920212223
24252627282930

Search

Polls

  • Who will rule the world?

    View Results

    Loading ... Loading ...