MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

DATABASE & SQL/PLSQL

Displaying Rows Using Logical & List Operators
Previous Home Next

Using Logical Operator

Multiple search condition done by using logical operator. They are:

  1. OR: Any of the specified search condition is true.
  2. SELECT column_list
    FROM table_name
    WHERE  condition_expression OR condition_expression
    

    Return all rows specific to the conditions, even if any one of the condition is true.

  3. AND: When all specified search conditions are true.
  4. SELECT column_list
    FROM table_name
    WHERE  condition_expression AND condition_expression
    

    Return all rows specific to the conditions, when both conditions are true.

  5. NOT: Neutralizes the expression that follow it.
  6. SELECT column_list
    FROM table_name
    WHERE  condition_expression {OR/AND} NOT  condition_expression
    

    Return all rows specific to the conditions, except the rows that match the condition specified after the NOT operatoor.

 

Using List Operator

SQl provides IN and NOT IN operators. IN operator that allowed the selection of values that match any one of the values in a list. NOT IN operator restrict the selection of values that match any one of the values in a list.

SELECT column_list
FROM table_name
WHERE  condition list_operator('value_list') 
  1. list_operator is any valid list operator.
  2. value_list is the list of values to be included or excluded in the condition

Example:

SELECT * 
FROM publishers
WHERE state IN ('MA','DC')

SELECT * 
FROM publishers
WHERE state NOT IN ('MA','DC') 
Previous Home Next