Skip to content

Commit df4fbc1

Browse files
committed
Time: 1368 ms (64.33%) | Memory: 0B (100.00%) - LeetSync
1 parent 2cf7c54 commit df4fbc1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
SELECT
2+
v.customer_id,
3+
COUNT(v.visit_id) AS count_no_trans
4+
FROM
5+
Visits AS v
6+
-- Juntamos todas as visitas com as transações
7+
LEFT JOIN
8+
Transactions AS t
9+
ON
10+
v.visit_id = t.visit_id
11+
WHERE
12+
-- Se o ID da transação for nulo, significa que a visita não gerou compra
13+
t.transaction_id IS NULL
14+
GROUP BY
15+
v.customer_id;

0 commit comments

Comments
 (0)