Reputation: 2240
Many languages have a construction that fills a syntactic position of a statement but has no effect: pass
in Python, \relax
in TeX, CONTINUE
in Fortran, ;
in C and Perl.
What is its equivalent in MySQL? That is, a query that would be syntactically correct but have no effect -- apart from confusing expressions like SELECT * FROM table LIMIT 0
.
This is useful when the queries are generated automatically and at some point the generation procedure is expected to generate a query but there is no action to do.
Upvotes: 4
Views: 2601
Reputation: 11
When doing from cli client you can also just call the quit function as you enter like this:
mysql -e '\q'
Upvotes: 0
Reputation: 778
First what comes to mind is just SELECT null
or something similar.
Edit:
Unlike SELECT null
, set @noop = null
does nothig
Upvotes: 0
Reputation: 164089
This query:
SELECT 1 FROM DUAL WHERE false
or simpler in MySql 8.0+:
SELECT 1 WHERE false
return nothing, if this is what you mean when you say no effect.
Upvotes: 3