subquery in FROM must have an alias subquery in FROM must have an alias oracle oracle

subquery in FROM must have an alias


Add an ALIAS onto the subquery,

SELECT  COUNT(made_only_recharge) AS made_only_rechargeFROM        (        SELECT DISTINCT (identifiant) AS made_only_recharge        FROM cdr_data        WHERE CALLEDNUMBER = '0130'        EXCEPT        SELECT DISTINCT (identifiant) AS made_only_recharge        FROM cdr_data        WHERE CALLEDNUMBER != '0130'    ) AS derivedTable                           -- <<== HERE


In the case of nested tables, some DBMS require to use an alias like MySQL and Oracle but others do not have such a strict requirement, but still allow to add them to substitute the result of the inner query.