1581.sql (170B)
1 SELECT V.customer_id, COUNT(V.visit_id) AS count_no_trans 2 FROM Visits V 3 LEFT JOIN Transactions T 4 ON V.visit_id = T.visit_id 5 WHERE T.amount IS NULL 6 GROUP BY V.customer_id