Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT( contact_a.id ) AS id
- FROM civicrm_contact contact_a
- LEFT JOIN civicrm_group_contact `civicrm_group_contact-605`
- ON contact_a.id = `civicrm_group_contact-605`.contact_id
- LEFT JOIN civicrm_group_contact `civicrm_group_contact-608`
- ON contact_a.id = `civicrm_group_contact-608`.contact_id
- LEFT JOIN civicrm_group_contact `civicrm_group_contact-612`
- ON contact_a.id = `civicrm_group_contact-612`.contact_id
- WHERE ( (( ( `civicrm_group_contact-605`.group_id IN ( 605 )
- AND `civicrm_group_contact-605`.status IN ( "Added" ) )
- OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
- FROM civicrm_contact contact_a
- LEFT JOIN civicrm_value_1_riding__circonscription
- ON
- civicrm_value_1_riding__circonscription.entity_id
- =
- contact_a.id
- WHERE (
- civicrm_value_1_riding__circonscription.riding
- =
- 47001
- )
- AND ( 1 )
- AND 1)
- AND contact_a.id NOT IN (SELECT contact_id
- FROM civicrm_group_contact
- WHERE
- civicrm_group_contact.group_id = 605
- AND civicrm_group_contact.status =
- "Removed")
- )) ))
- OR (( ( `civicrm_group_contact-608`.group_id IN ( 608 )
- AND `civicrm_group_contact-608`.status IN ( "Added" ) )
- OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
- FROM civicrm_contact contact_a
- LEFT JOIN civicrm_value_1_riding__circonscription
- ON
- civicrm_value_1_riding__circonscription.entity_id
- =
- contact_a.id
- WHERE (
- civicrm_value_1_riding__circonscription.riding
- =
- 47004
- )
- AND ( 1 )
- AND 1)
- AND contact_a.id NOT IN (SELECT contact_id
- FROM civicrm_group_contact
- WHERE
- civicrm_group_contact.group_id =
- 608
- AND civicrm_group_contact.status
- =
- "Removed")
- )) ))
- OR (( ( `civicrm_group_contact-612`.group_id IN ( 612 )
- AND `civicrm_group_contact-612`.status IN ( "Added" ) )
- OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
- FROM civicrm_contact contact_a
- LEFT JOIN civicrm_value_1_riding__circonscription
- ON
- civicrm_value_1_riding__circonscription.entity_id
- =
- contact_a.id
- WHERE (
- civicrm_value_1_riding__circonscription.riding
- =
- 47008
- )
- AND ( 1 )
- AND 1)
- AND contact_a.id NOT IN (SELECT contact_id
- FROM civicrm_group_contact
- WHERE
- civicrm_group_contact.group_id =
- 612
- AND civicrm_group_contact.status
- =
- "Removed")
- )) )) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement