for example we have a table with the columns "id", "name", "type", "year".
My target output would be SELECT CONCAT(id, name, type, year) FROM table
.
Is it possible to do this without knowing the columns, so I can use it with every table I want without analysing its columns first? Something like CONCAT(*)
?
I hope you can help me.
Thank you very much.
Regards Wulf
AFAIK, you first have to know the columns. This
SHOW COLUMNS FROM table
will return all columns. Use the result to make your SELECT
query.
Check the information_schema table of MySQL, it contains meta-information concerning your tables. http://dev.mysql.com/doc/refman/5.0/en/information-schema.html
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