You can’t use dynamic column names or sorting order based on parameters in your custom queries.
Same topic discussed here: Creating Custom SQL Queries
You can’t use dynamic column names or sorting order based on parameters in your custom queries.
Same topic discussed here: Creating Custom SQL Queries