Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Consider the 2 below tables
- DETAILS table:-
- email Name Region PostalCode
- a@b.com Mike US-east 1234
- a@b.com Sara US-east 2341
- a@b.com Sara US-west 1234
- b@c.com Ash US-west 6542
- b@c.com Cindy US-west 4213
- c@d.com George US-east 1234
- c@d.com Thomas US-east 3412
- EMAIL_STATUS table:-
- email status
- a@b.com In progress
- c@d.com Resolved
- expected result:-
- email Name Region PostalCode status count(*)
- a@b.com Mike US-east 1234 In progress 3
- b@c.com Ash US-west 6542 null 2
- c@d.com George US-east 1234 Resolved 2
- I tried various queries but none seem to work in order to get the result i expect as it leads to errors due to group by.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement