sql >> Base de Datos >  >> RDS >> Oracle

Oracle/SQL:combinación de recuentos de tablas no relacionadas 'no relacionadas'

Prueba esto:

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