How can I select and concat every field in a row?
I want to do something similar to this:
SELECT concat(SELECT GROUP_CONCAT(COLUMN_NAME)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'tbl_name')
as single FROM tbl_name
..but obviously the above doesn’t work. Any suggestions?
You will have the build the query dynamically, i.e. list all columns in
concat(...)explicitly. You can do that on the client side by running two queries or in a stored procedure using a prepared statement.