Hi,
I am trying to query a sybase databse via a ODBC ASE connection within SSRS.
However I get the following error when I attempt a query that uses a derived table:
Code:
SELECT application_name
FROM ( SELECT CASE WHEN name IN ('appliction_1', 'application_2') THEN 'My Application'
WHEN name IN ('appliction_3', 'application_4') THEN 'Your Application'
ELSE 'Other Application' END AS application_name
FROM tbl_applications
ORDER BY name ) x
WHERE application_name != 'Other Application'
ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near 'FROM'.
Any ideas? I've tried SELECT x.application_name but I still get the same error.