
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How to select an empty result set in MySQL?
Select an empty result set with the help of dummy table ‘dual’ from MySQL. The query is as follows −
mysql> select 1 from dual where false; Empty set (0.00 sec)
In the above query, “dual” is a dummy table and the above condition false. Therefore, it returns empty set.
Let us check with true condition. It will return the selected value. The query is as follows −
mysql> select 1 from dual where true;
The following is the output −
+---+ | 1 | +---+ | 1 | +---+ 1 row in set (0.00 sec)
- Related Articles
- What is the meaning of ‘empty set’ in MySQL result set?
- How to avoid null result of “SELECT max(rank) FROM test” for an empty table?
- How can we use SET statement to assign a SELECT result to a MySQL user variable?
- How to set default value for empty row in MySQL?
- How to create an empty VIEW in MySQL?
- How to replace 'Empty set' in a MySQL query?
- How to make MySQL result set the same as specified?
- MySQL query to get result from multiple select statements?
- How Can MySQL operator precedence affect result set?
- How to select from a set of integers in MySQL?
- How to select first and last data row from a MySQL result?
- How can you order the result obtained by select query in MySQL?
- How to create a MySQL table based on JDBC Result Set?
- Select with set order in MySQL
- In MySQL, how can we randomize set of rows or values in the result set?

Advertisements