Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- DISTINCT au.name
- FROM
- auser au
- JOIN sf_guard_user_group sgug ON au.auser_id = sgug.auser_id
- LEFT JOIN auser_schet ash ON au.auser_id = ash.user_id
- AND ash.id_service = 6
- AND ash.money > 0
- AND ash.date_operation BETWEEN NOW() - INTERVAL ash.period DAY
- AND NOW()
- WHERE
- 1 = 1
- AND au.is_published = 1
- AND au.is_profi_paket = 1
- AND sgug.group_id IN (3, 6)
- AND ash.id IS NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement