order by....

How can I make a select statement that orders results as I need… for example

Select * from t where x=y order by x;

if you want 1,2,3 or 3,2,1 … but what if you need 2,1,3?

Do a google search on COLLATION … basically its like the SORTWITH feature for Xojo Arrays but for Database tables

Or have an extra field that contains data which will sort in ‘normal’ asc or desc


order by sorter, get 2,1,3 from REAL

I sorta get it… :wink:
Except for the REAL, SORTER… Is that meant to be a table?

REAL refers to your existing field
SORTER is a new field where you put a value that mimics what a table collate would do

Old thread, but I thought I’d mention this:

Select * from t where x=y order by x=2 desc,x=1 desc,x=3 desc