Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Oracle/SQL - Combinando contagens de tabelas não relacionadas 'não relacionadas'


Tente isto:
SELECT (SELECT COUNT(*) AS good 
        FROM   table_good 
        WHERE  widget = 'Widget A' 
               AND good = 'Y') AS good, 
       (SELECT COUNT(*) AS bad 
        FROM   table_bad 
        WHERE  widget = 'Widget A' 
               AND bad = 'Y')  AS bad 
FROM   dual