I have this query that I wrote in PostgreSQL that returns an error:
[Err] ERROR:
LINE 3: FROM (SELECT DISTINCT (identifiant) AS made_only_recharge
This is the whole query:
SELECT COUNT (made_only_recharge) AS made_only_recharge FROM ( 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' )
I have a similar query in Oracle that works fine. The only change is where I have EXCEPT in Oracle, I replaced it with the MINUS keyword. I'm new to Postgres and don't know what he is asking for. What is the right way to handle this?
sql oracle postgresql subquery
roykasa Feb 08 '13 at 6:50 2013-02-08 06:50
source share