Is it possible to order by a selected columnname?
SELECT * FROM tablex ORDER BY quote_ident(( select column_name from information_schema.columns where table_name = tablex AND column_name LIKE 'Index')) ASC;
The output of this is not ordered according to the columnname Index.
So basically my question is if i can use a select query in the order by clause like this simple one:
SELECT * FROM tablex ORDER BY (SELECT Index FROM table WHERE....);
What did i oversee?