I have built the following query running fine on Sybase engines :
select *,
(select COUNT(*) from myTable where column1 != '' and column2!=column3) as myField1,
(select COUNT(*) from myTable where column1 != '' and column2=column3) as myField2
from
(select column1,column2,column3,column4,column5
from myTable
where column1 != '' and column2 != column3) as SUB_VIRTUAL_TABLE
However, running the same query on Oracle engines will raise the following exception:
ORA-00923: FROM keyword not found where expected
Could please anyone help to fix this syntax? Thanks a lot. P.s.: tables and columns exist, the query is indeed running fine when the engine is Sybase.
The expected result would look like this:
column1 | column2 | column3 | column4 | column5 | myField 1 | myField2
-----------------------------------------------------------------------
A B C D E 12 15
E F G H I 12 15
...