Slide 35
Slide 35 text
-- Things we have sold that have been cancelled that we are
still billing for.
SELECT *
FROM billing_records, products
WHERE billing_records.deleted_at IS NULL
AND products.deleted_at IS NOT NULL
AND billing_records.products_id = products.id
AND products.deleted_at < NOW() - interval '15 minutes'|)