SELECT in mysql using column number instead of name

gran_profaci picture gran_profaci · Jul 13, 2013 · Viewed 22.9k times · Source

Is there any way to do something like :

SELECT * FROM TABLE WHERE COLUMN_NUMBER = 1;

?

Answer

Ben Harris picture Ben Harris · Jul 13, 2013

No, you can't. Column order doesn't really matter in MySQL. See the below question for more details.

mysql - selecting values from a table given column number