In MySQL, select *,1 from t appears to be valid, but select 1,* from t is not.
From the MySQL docs, you are told what you can do with the unqualified *:
A select list consisting only of a single unqualified
*can be used as shorthand to select all columns from all tables:
SELECT * FROM t1 INNER JOIN t2 ...
The pertinent documentation you're looking for is two bullet points below that:
Use of an unqualified
*with other items in the select list may produce a parse error. To avoid this problem, use a qualifiedtbl_name.*reference
Unfortunately the why is not explained in the docs, and would likely take some digging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With