It used to be that I could fire a query like the following in a query window/sql command line, against MS SQL server:
SELECT foo1, foo2, * from bar
Basically show the specified columns followed by rest of the columns. But MySQL does not allow this; throws back a syntax error at me. Is there an alternative syntax to do this in MySQL? Note that I am NOT trying to do this in code (where it has no practical use); I am using it for firing random queries against my DB to look up information.
Just declare the table on the SELECT CLAUSE.
SELECT foo1, foo2, bar.* from bar;
OR
SELECT b.foo1, b.foo2, b.* from bar b;
;-)
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