I want to make a SELECT and bring the info from a column and his values. I know that I need to access *information_schema* then I need to make another SELECT inside with the *column_name* in the specific row to acess that value.
SELECT column_name,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
(? ... SELECT COLUMN_NAME FROM MYTABLE ... ?)
FROM information_schema.columns
WHERE table_name = 'MYTABLE'
ORDER BY ordinal_position
How to change the COLUMN_NAME with the column in the row to get the result?
I don’t know how you want this if there are more than one row in your table. This will work for a table with one row. If there are more than one row in the table it will take one of the rows in the table.
SQL Fiddle