Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.72 KB | None | 0 0
  1. SELECT DISTINCT
  2.     `identity`.`entity_id`,
  3.     `identity`.`owner_id`,
  4.     `identity`.`classid`,
  5.     `identity`.`name`,
  6.     `identity`.`deleted`,
  7.     `identity`.`datetime`,
  8.     `identity`.`keywords`,
  9.     `identity`.`uniquetypekey`,
  10.     `identity`.`sortpriority`,
  11.     `identity`.`guid`,
  12.     `identity`.`instancerole`,
  13.     `identity`.`gdsrole`,
  14.     `identity`.`gdsowner_guid`,
  15.     `profile`.`profile_id`,
  16.     `profile`.`profile_oid`,
  17.     `profile`.`picture_id`,
  18.     `profile`.`video_id`,
  19.     `profile`.`logopic_id`,
  20.     `profile`.`descrshort`,
  21.     `profile`.`descrfull`,
  22.     `accountentity`.`accountentity_id`,
  23.     `accountentity`.`accountentity_oid`,
  24.     `accountentity`.`accounttype`,
  25.     `accountentity`.`registrationno`,
  26.     `accountentity`.`vatid`,
  27.     `accountentity`.`vatregistration`,
  28.     `accountentity`.`vatoption`,
  29.     `accountentity`.`vatrate`,
  30.     `user`.`user_id`,
  31.     `user`.`user_oid`,
  32.     `user`.`userstatus`,
  33.     `user`.`namefirst`,
  34.     `user`.`namesecond`,
  35.     `user`.`email`,
  36.     `user`.`phone`,
  37.     `user`.`dob`,
  38.     `user`.`newsletter`,
  39.     `user`.`gender`,
  40.     `user`.`titlebefore`,
  41.     `user`.`titleafter`
  42. FROM
  43.     `identity`
  44.         INNER JOIN
  45.     `profile` ON `profile`.`profile_id` = `identity`.`entity_id`
  46.         AND `profile`.`profile_oid` = `identity`.`owner_id`
  47.         INNER JOIN
  48.     `accountentity` ON `accountentity`.`accountentity_id` = `profile`.`profile_id`
  49.         AND `accountentity`.`accountentity_oid` = `profile`.`profile_oid`
  50.         INNER JOIN
  51.     `user` ON `user`.`user_id` = `accountentity`.`accountentity_id`
  52.         AND `user`.`user_oid` = `accountentity`.`accountentity_oid`
  53. WHERE
  54.     (`identity`.`owner_id` = 12)
  55.         AND (`identity`.`owner_id` = 12)
  56.         AND `identity`.`deleted` = 0
  57.         AND EXISTS( SELECT
  58.             1
  59.         FROM
  60.             `profiletypelink` AS s44t0
  61.         WHERE
  62.             (s44t0.`typecode` = 10)
  63.                 AND s44t0.`t_profile_id` = `profile`.`profile_id`
  64.                 AND s44t0.`t_profile_oid` = `profile`.`profile_oid`)
  65.         AND  EXISTS( SELECT
  66.             1
  67.         FROM
  68.             `profileattrlink` AS s45t0
  69.         WHERE
  70.              ( EXISTS( SELECT
  71.                     1
  72.                 FROM
  73.                     `profileattrlink` AS s46t0
  74.                 WHERE (
  75.                     select 1 from `profileattribute` pattr
  76.                     where pattr.t_group_id = 2794                
  77.                     and pattr.attribute_id = s46t0.t_attribute_id
  78.                     and pattr.attribute_oid = s46t0.t_attribute_oid
  79.                 )))
  80.                 AND s45t0.`t_profile_id` = `profile`.`profile_id`
  81.                 AND s45t0.`t_profile_oid` = `profile`.`profile_oid`)
  82. ORDER BY `identity`.`name` asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement