Advertisement
Guest User

13

a guest
Nov 21st, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. select PT."Name", count(*)
  2. from "AgentEmails" as AE
  3. join "Agents" A on ae."AgentId" = A."AgentId"
  4. join "AgentProductTypes" APT on A."AgentId" = APT."AgentId"
  5. join "ProductTypes" PT on APT."ProductTypeId" = PT."EnumId"
  6. where APT."ProductTypeId" in (1, 4, 25)
  7. group by PT."Name"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement