Jump to content
  • 0

Custom Report: Get Email Addresses Of Users Of A Service Group


André P.

Question

3 answers to this question

Recommended Posts

  • 0

This will get you more info for context, or you can remove the fields just for the email addresses:

SELECT `contacts`.`client_id`, `contacts`.`id` AS `contact_id`, `contacts`.`first_name`, `contacts`.`last_name`, `contacts`.`email`, `services`.`status`, `services`.`date_canceled`, COUNT(`services`.`id`) AS `number_of_services`
FROM `contacts`
INNER JOIN `services` ON `services`.`client_id` = `contacts`.`client_id`
WHERE `services`.`status` = 'active'
AND `services`.`package_group_id` = '1'
GROUP BY `contacts`.`id`
ORDER BY `contacts`.`client_id`, `contacts`.`id`
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...