TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL ALL Operator

Overview

In this tutorial, we will learn about MySQL ALL Operator with example. The ALL operator is quantified comparison operator. The quantifier keywords ALL, ANY, and SOME allow comparison with multiple rows.

To perform a comparison between a scalar value and a subquery that returns several rows of data
in a column subquery, we must use a quantified comparison.

We can use the ALL comparison operator construct in a comparison with a column subquery limits the result set to only those rows where the comparison is true for all values produced by the subquery.

Example

In this example, we will use the City table from the world MySQL database.

City Table Structure World Database

ALL Operator

Let’s find the names of cities which have population greater than all the cities in the United States. We can use the ALL operator against the column subquery that returns the rows of the Population column from the City table where the country code matches USA.

mysql> SELECT Name FROM City
-> WHERE Population >
-> ALL (SELECT Population FROM City
-> WHERE CountryCode =’USA’);

+——————-+
| Name |
+——————-+
| São Paulo |
| Jakarta |
| Mumbai (Bombay) |
| Shanghai |
| Seoul |
| Ciudad de México |
| Karachi |
| Istanbul |
| Moscow |
+——————-+
9 rows in set (0.01 sec)

 

MySQL ALL Operator

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

Windows 11 Services Run Prompt

MySQL /

Start MySQL Server on Windows 11

MySQL Community Downloads TDocs

MySQL /

Download & Install MySQL on Windows 11

‹ MySQL EXISTS Operator› MySQL ANY Operator

Recent Posts

  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • RAPTOR Editions
  • Flowgorithm Conditional Breakpoint Statement
  • Flowgorithm Read Numbers from File Example
  • Search Text File Flowchart Example
  • Flowgorithm Turtle Graphics Symbols
  • Draw Circle using Flowgorithm Turtle
  • Draw Parallel Lines using Flowgorithm Graphics

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version