sql8(Leetcode1581进店却未进行过交易的顾客)

1114-2

代码:

# Write your MySQL query statement below
SELECT Visits.customer_id,count(customer_id) AS count_no_trans
FROM Visits LEFT JOIN Transactions 
ON Visits.visit_id=Transactions.visit_id
WHERE transaction_id IS NULL
GROUP BY customer_id

你可能感兴趣的:(leetcode)