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

Queries with modified Comparison Operators
Previous Home Next

SQL server provides the ALL and ANY keywords that can be used to modify the existing comparison operator. The sub query introduced with a modified comparison operator returns zero or more values and can be implemented using the GROUP BY or HAVING clause.

OperatorDescription

>ALL

Means greater than the maximum value in the list.

column_name>ALL (10,20,30) means 'greater than 30'

>ANY

Means greater than the minimum value in the list.

column_name>ANY (10,20,30) means 'greater than 10'

=ANY

Means any of the values in the list. It acts in the same way as the IN clause

column_name=ANY (10,20,30) means 'equal to either 10 or 20 or 30'

<>ANY

Means not equal to any in the list.

column_name<>ANY (10,20,30) means 'not equal to either 10 or 20 or 30'

<>ALL

Means not equal to all the values in the list. It acts in the same way as the NOT IN clause.

column_name<>ALL (10,20,30) means 'not equal to either 10 and 20 and 30'

 

Example

 SELECT title_id ,title
FROM titles
WHERE price> ALL (SELECT price FROM titles WHERE pub_id='0736')
  

output

Display the title_id and title where price is greater than the maximum price of books published by the publisher with the publisher ID 0736

 SELECT title_id ,title
FROM  titles
WHERE  price>ANY(SELECT  price  FROM titles  WHERE pub_id='0736')
 

output

Display the title_id and title where price is greater than the minimum price of books published by the publisher with the publisher ID 0736

Previous Home Next