Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.43 KB | None | 0 0
  1. SELECT
  2.     DISTINCT au.name
  3. FROM
  4.     auser au
  5.     JOIN sf_guard_user_group sgug ON au.auser_id = sgug.auser_id
  6.     LEFT JOIN auser_schet ash ON au.auser_id = ash.user_id
  7.     AND ash.id_service = 6
  8.     AND ash.money > 0
  9.     AND ash.date_operation BETWEEN NOW() - INTERVAL ash.period DAY
  10.     AND NOW()
  11. WHERE
  12.     1 = 1
  13.     AND au.is_published = 1
  14.     AND au.is_profi_paket = 1
  15.     AND sgug.group_id IN (3, 6)
  16.     AND ash.id IS NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement