Je cherchais une requête qui renvoit un résultat vide avec :

SELECT 1 WHERE 0;
mysql> SELECT 1 WHERE 0;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE 0' at line 1

C'est là que la table fictive DUAL apparaît :

SELECT 1 FROM DUAL WHERE 0;
mysql> SELECT 1 FROM DUAL WHERE 0;
Empty set (0.00 sec)

MariaDB [(none)]> 

Tadaaa !

Source: https://dev.mysql.com/doc/refman/5.5/en/select.html

Previous Post Next Post