ora-00905

how to get this order by working in oracle pl/sql

ORDER BY CASE WHEN v_SORT_TYPE = 'ASC' THEN CASE WHEN v_SORT_ORDER = 'lname' THEN CAST(lname AS VARCHAR2(45)) || ',' || ROWNUM WHEN v_SORT_ORDER = 'code' THEN CAST(code AS VARCHAR2(52)) || ',' || ROWNUM END ASC WHEN v_SORT_TYPE = 'DSC' THEN CASE WHEN v_SORT_ORDER = 'lname' ...

ORA-00905: Trouble converting Mysql/MMSQL syntax to oracle syntax

Hi guys i'm having trouble running the below code on an Oracle DB not too sure why - getting ORA-905 error - missing keyword This works fine on MSSQL and MYSQL. Any indication as to how to fix will be much appreciated. Cheers. SELECT product.productId, product.version FROM product INNER JOIN (SELECT productId, MA...