I need to order a table but I don't know how columns will be selected by user.
Example:
select *
from table
order by field1, field2, field3
But the user can change fields order: field3, field1, field2
I was thinking in something like that:
select *
from table
order by
some_fuction (
field1, priority
field2, priority
field3, priority
)
Where I can set the priority in each field. Is it possible?
Thanks, Anderson