I need to count the number of spreadsheets in a range in table A
, and I require that only count the number of spreadsheets that are TIPO
CORRECTIVO
, which is find in table B
, I have the following query but I get a result or number of spreadsheets that does not match the correct result.
SELECT COUNT(A.PLANILLA) FROM acta_entrega A, control_planillas B
WHERE A.PLANILLA BETWEEN 002801 AND 002900
AND B.TIPO = 'CORRECTIVO'