Created
June 30, 2011 20:38
-
-
Save hampelm/1057176 to your computer and use it in GitHub Desktop.
CiviCRM Stale Contacts Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM civicrm_contact | |
WHERE id NOT | |
IN ( 1 ) | |
SELECT * | |
FROM civicrm_log | |
WHERE entity_table='civicrm_contact' | |
LEFT_JOIN civicrm_contact ON civicrm_log.entity_id=civicrm_contact.id | |
SELECT civicrm_log.entity_id, civicrm_contact.first_name FROM civicrm_log | |
LEFT JOIN civicrm_contact ON civicrm_log.entity_id=civicrm_contact.id | |
WHERE civicrm_log.entity_table='civicrm_contact' | |
SELECT first_name, last_name from civicrm_contact | |
WHERE id NOT IN | |
( | |
SELECT entity_id | |
FROM civicrm_log | |
WHERE entity_table='civicrm_contact' | |
AND modified_date > '2011-02-16 17:16:41' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment