Is it possible to get the name of the column to which the database record belongs?
Maybe I have three columns with column names col1, col2 and col3. Now I want to select the column with the maximum record for each column, something like this.
Select name_of_column(max(col1,col2,col3)).
I know that I can query the column name by its ordinal position in the information_schema.COLUMNS table, but how to get the ordinal position of the database record in the table?
source
share