Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *,
- COUNT(*) as counter
- FROM
- customers c
- LEFT JOIN invoices i ON c.CustomerId = i.CustomerId
- GROUP BY
- i.CustomerId
- HAVING
- counter = (
- SELECT
- COUNT(i.CustomerId)
- FROM
- invoices i
- GROUP BY
- i.CustomerId
- LIMIT 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement