mysql - Error #1064, with Select column,* from table -
okay, debugging , found wired error, should documented somewhere, search mysql documentation , didn't found anything. here sql query, produce 1064 error near * table,
select char_length(zip), zip, * tbllocations but below 1 works fine:
select *, char_length(zip), zip tbllocations cannot use * @ end of column list? test query on mysql 5.5.41 , mysql 5.0.95. didn't notice error before. rewrite query avoid special/hidden characters.
aren't same query except change in order of columns? explanation or resource one.
edit:
just run select char_length(zip), zip, tbllocations.* tbllocations , works fine? looks hitting bug? or logical, missing?
from mysql docs:
a select list consisting of single unqualified * can used shorthand select columns tables:
select * t1 inner join t2 ... tbl_name.*can used qualified shorthand select columns named table:
select t1.*, t2.* t1 inner join t2 ...use of unqualified * other items in select list may produce parse error. avoid problem, use qualified tbl_name.* reference
select avg(score), t1.* t1 ...
Comments
Post a Comment