Home About US Matrimonial Education Recipis Inquiry Contact US
USER ID PASSWORD
New Member Forget Password
 
Member
24 Gaam
Hospital Project
School Project
Vibrant Newsletter
Events / News
Essay
Entertament
Services
Business
Health
Religion
Arts / Calture
Other Samaj
Help
 
 
  EDUCATION
   
 
Education :- Computer :- SQL TUTORIAL :- IN & BETWEEN


An easier method of using compound conditions uses IN or BETWEEN. For example, if you wanted to list all managers and staff:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE POSITION IN ('Manager', 'Staff');

or to list those making greater than or equal to $30,000, but less than or equal to $50,000, use:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY BETWEEN 30000 AND 50000;

To list everyone not in this range, try:

SELECT EMPLOYEEIDNO
FROM EMPLOYEESTATISTICSTABLE
WHERE SALARY NOT BETWEEN 30000 AND 50000;

Similarly, NOT IN lists all rows excluded from the IN list.

Additionally, NOT's can be thrown in with AND's & OR's, except that NOT is a unary operator (evaluates one condition, reversing its value, whereas, AND's & OR's evaluate two conditions), and that all NOT's are performed before any AND's or OR's.

SQL Order of Logical Operations (each operates from left to right)

  1. NOT
  2. AND
  3. OR

 

 
 
 
 
 
 
 
 
Site Design By :- www.ebeesinfo.com
Site Best View in 1024 X 768
Home | About US | Terms and conditions | Education | Matrimonial | Resipis | Inquiry | Contact US
Copy Right 2008, www.24gaam.com