Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select PT."Name", count(*)
- from "AgentEmails" as AE
- join "Agents" A on ae."AgentId" = A."AgentId"
- join "AgentProductTypes" APT on A."AgentId" = APT."AgentId"
- join "ProductTypes" PT on APT."ProductTypeId" = PT."EnumId"
- where APT."ProductTypeId" in (1, 4, 25)
- group by PT."Name"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement