- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What happens if MySQL query returns no rows?
From the output returned by MySQL, it is very much clear that how many rows are there in the result set along with the execution time.
Example
For example, in the following MySQL output we can see there are 3 rows in the result set.
mysql> Select * from ratelist ORDER BY Price LIMIT 3; +----+------+-------+ | Sr | Item | Price | +----+------+-------+ | 5 | T | 250 | | 1 | A | 502 | | 2 | B | 630 | +----+------+-------+ 3 rows in set (0.00 sec)
But suppose if MySQL query has no rows to be returned in the result set then it will return Empty Set along with the execution time. In other words, we can say that MySQL returns no data and no error. Consider the following example in which write a MySQL query whose output is an empty set.
mysql> Select * from ratelist where price > 2000; Empty set (0.08 sec)
We can see the empty set and execution time as output.
Advertisements