Advertisement
stan_rnao

civicrm query

Sep 2nd, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 6.74 KB | None | 0 0
  1. | 495728 | live_civicrm | localhost       | live_civicrm | Query   |  188 | Copying to tmp table | SELECT contact_a.id as contact_
  2. id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_na
  3. me`, contact_a.display_name  as `display_name`, contact_a.do_not_email  as `do_not_email`, contact_a.do_not_phone  as `do_not_phon
  4. e`, contact_a.do_not_mail  as `do_not_mail`, contact_a.do_not_sms  as `do_not_sms`, contact_a.do_not_trade  as `do_not_trade`, con
  5. tact_a.is_opt_out  as `is_opt_out`, contact_a.legal_identifier  as `legal_identifier`, contact_a.external_identifier  as `external
  6. _identifier`, contact_a.nick_name  as `nick_name`, contact_a.legal_name  as `legal_name`, contact_a.image_URL  as `image_URL`, con
  7. tact_a.preferred_communication_method  as `preferred_communication_method`, contact_a.preferred_language  as `preferred_language`,
  8.  contact_a.preferred_mail_format  as `preferred_mail_format`, contact_a.hash  as `hash`, contact_a.source  as `contact_source`, co
  9. ntact_a.first_name  as `first_name`, contact_a.middle_name  as `middle_name`, contact_a.last_name  as `last_name`, contact_a.prefi
  10. x_id  as `prefix_id`, contact_a.suffix_id  as `suffix_id`, contact_a.formal_title  as `formal_title`, contact_a.communication_styl
  11. e_id  as `communication_style_id`, contact_a.job_title  as `job_title`, contact_a.gender_id  as `gender_id`, contact_a.birth_date
  12.  as `birth_date`, contact_a.is_deceased  as `is_deceased`, contact_a.deceased_date  as `deceased_date`, contact_a.household_name  
  13. as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, contact
  14. _a.sic_code  as `sic_code`, contact_a.user_unique_id  as `user_unique_id`, contact_a.employer_id  as `current_employer_id`, contac
  15. t_a.is_deleted  as `contact_is_deleted`, contact_a.created_date  as `created_date`, contact_a.modified_date  as `modified_date`, c
  16. ontact_a.addressee_id as addressee_id, contact_a.addressee_display as addressee_display, contact_a.addressee_custom as addressee_c
  17. ustom, contact_a.email_greeting_id as email_greeting_id, contact_a.email_greeting_display as email_greeting_display, contact_a.ema
  18. il_greeting_custom as email_greeting_custom, contact_a.postal_greeting_id as postal_greeting_id, contact_a.postal_greeting_display
  19.  as postal_greeting_display, contact_a.postal_greeting_custom as postal_greeting_custom, IF ( contact_a.contact_type = 'Individual
  20. ', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_location_type.id as location
  21. _type_id, civicrm_location_type.name as `location_type`, civicrm_address.street_address as `street_address`, civicrm_address.stree
  22. t_number as `street_number`, civicrm_address.street_number_suffix as `street_number_suffix`, civicrm_address.street_name as `stree
  23. t_name`, civicrm_address.street_unit as `street_unit`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm
  24. _address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as
  25.  `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.g
  26. eo_code_2 as `geo_code_2`, civicrm_address.name as `address_name`, civicrm_address.master_id as `master_id`, civicrm_address.count
  27. y_id as county_id, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone
  28. .id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_phone.phone_ext as `phone_e
  29. xt`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_email.is_bulkmail a
  30. s `is_bulkmail`, civicrm_email.signature_text as `signature_text`, civicrm_email.signature_html as `signature_html`, civicrm_im.id
  31.  as im_id, civicrm_im.provider_id as `im_provider`, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_openid
  32. .id as openid_id, civicrm_openid.openid as `openid`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_
  33. region`, civicrm_website.id as website_id, civicrm_website.url as `url`, GROUP_CONCAT(DISTINCT(civicrm_group.title)) as groups, GR
  34. OUP_CONCAT(DISTINCT(civicrm_tag.name)) as tags, GROUP_CONCAT(DISTINCT(civicrm_note.note)) as notes, `civicrm_group_contact-2031412
  35. `.id as group_contact_id, `civicrm_group_contact-2031412`.status as status  FROM civicrm_contact contact_a LEFT JOIN civicrm_addre
  36. ss ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_email ON (contact_a.id =
  37. civicrm_email.contact_id AND civicrm_email.is_primary = 1)  LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AN
  38. D civicrm_phone.is_primary = 1)  LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1)  LEF
  39. T JOIN civicrm_openid ON ( civicrm_openid.contact_id = contact_a.id AND civicrm_openid.is_primary = 1 ) LEFT JOIN civicrm_location
  40. _type ON civicrm_address.location_type_id = civicrm_location_type.id   LEFT JOIN civicrm_group_contact ON civicrm_group_contact.co
  41. ntact_id = contact_a.id AND civicrm_group_contact.status = 'Added'    LEFT JOIN civicrm_group_contact_cache ON civicrm_group_conta
  42. ct_cache.contact_id = contact_a.id   LEFT JOIN civicrm_group ON (civicrm_group.id = civicrm_group_contact.group_id OR civicrm_grou
  43. p.id = civicrm_group_contact_cache.group_id)  LEFT JOIN civicrm_entity_tag ON ( civicrm_entity_tag.entity_table = 'civicrm_contact
  44. ' AND
  45.                                                               civicrm_entity_tag.entity_id = contact_a.id )  LEFT JOIN civicrm_not
  46. e ON ( civicrm_note.entity_table = 'civicrm_contact' AND
  47.                                                         contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_country ON civi
  48. crm_address.country_id = civicrm_country.id  LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id  
  49.  LEFT JOIN civicrm_group_contact `civicrm_group_contact-2031412` ON (contact_a.id = `civicrm_group_contact-2031412`.contact_id AND
  50.  `civicrm_group_contact-2031412`.status IN ('Added'))   LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_2031412
  51. ` ON contact_a.id = `civicrm_group_contact_cache_2031412`.contact_id   LEFT  JOIN civicrm_tag ON civicrm_entity_tag.tag_id = civic
  52. rm_tag.id  LEFT JOIN civicrm_website ON contact_a.id = civicrm_website.contact_id  WHERE  ( ( ( `civicrm_group_contact-2031412`.gr
  53. oup_id IN ( 2031412 ) ) OR ( `civicrm_group_contact_cache_2031412`.group_id IN ("2031412") ) ) )  AND (contact_a.is_deleted = 0) A
  54. ND contact_a.is_deleted != 1  GROUP BY contact_a.id ORDER BY sort_name asc, contact_a.id LIMIT 10000, 10000 |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement