let's say i hae a table schema named person it has these columns listed below
id | name | age | gender | activities_in_order | created_date
the value for activities_in_order column is a boolean...true or false..
how to use this column as reference in a select statement itself ?
here's my pseudo code
SELECT * FROM Person ( if activities_in_order = true ORDER by field_here else if activities_in_order = false Order By field_here )
ORDER BYis applied to all rows from the result. The value of the column might change for every row. Please edit your question (by clicking on the edit link below it) and add some sample data and the expected output based on that data as formatted text. See here for some tips on how to create nice looking text tables. (edit your question - do not post code or additional information in comments)