PL/SQL Count

Oracle PL/SQL Count Example

Count Example 1:

SELECT count(c.approve)
FROM in_credit c
WHERE c.approve='YES'
AND c.product_id = (Select p.product_id
					From products p
					Where p.description='MORTGAGE'
				);

Count Example 2:

SELECT count(c.customer_id)
FROM customers c
WHERE c.customer_type = 'COMPANY'
AND c.customer_id IN (Select ctr.customer_id
						From contracts ctr 
						Where ctr.status='ACTIVE'
					);