VistaDB Support Center

Start a new topic

ORDER BY CASE

I tried following and it does not work in VistaDB. Can you please let me know if this supported in VISTADB


ORDER BY CASE WHEN SUBSTR(CONTAINER,1,4) = 'MSCU' THEN 1

WHEN SUBSTR(CONTAINER,1,4) = 'FSCU' THEN  2

WHEN SUBSTR(CONTAINER,1,4) = 'CIAU' THEN 3

ELSE 99

END


Works fine in SQL

1 Comment

VistaDB does not currently handle CASE in an ORDER BY.  However, you can probably work around it by using the CASE expression as one of the result columns and using the result column in the ORDER BY (particularly by its number).

Login to post a comment