Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: Philip Imperato
Added: Jun 4, 2018 4:58 PM
Views: 12
Tags: no tags
  1. SELECT * FROM "Users" AS "Users"
  2. LEFT OUTER JOIN "Roles" AS "Role" ON "Users"."roleId" = "Role"."roleId"
  3.         INNER JOIN ("Agency_XRef" AS "Agencies.Agency_XRef" INNER JOIN "Agencies" AS "Agencies" ON "Agencies"."agencyId" = "Agencies.Agency_XRef"."agencyId") ON "Users"."userId" = "Agencies.Agency_XRef"."userId"
  4.         AND "Agencies"."agencyId" IN (23)
  5. WHERE "Users"."roleId" IN (3, 4, 5, 6, 7, 8) AND "Users"."archived" = FALSE
  6. ORDER BY "Users"."email" ASC
  7.