Implement a MySQL Void Query that does nothing

MySQLMySQLi Database

Let us first create a table −

mysql> create table DemoTable(Name varchar(100));
Query OK, 0 rows affected (0.47 sec)

Insert some records in the table using insert command −

mysql> insert into DemoTable values('Chris');
Query OK, 1 row affected (0.13 sec)
mysql> insert into DemoTable values('Sam');
Query OK, 1 row affected (0.11 sec)
mysql> insert into DemoTable values('Robert');
Query OK, 1 row affected (0.37 sec)
mysql> insert into DemoTable values('Mike');
Query OK, 1 row affected (0.09 sec)

Display all records from the table using select statement −

mysql> select *from DemoTable;

This will produce the following output −

+--------+
| Name   |
+--------+
| Chris  |
| Sam    |
| Robert |
| Mike   |
+--------+
4 rows in set (0.00 sec)

Following is the query for MySQL void −

mysql> select *from DemoTable limit 0;
Empty set (0.00 sec)

Above, the result is Empty set and the query does nothing.

raja
Published on 03-Sep-2019 12:12:28
Advertisements