I’m having an issue with the execution time of the scripts in Zurmo so I have created the following SQL statement to extract the data I need:
SELECT `contact`.`id` contactid, `contact`.`companyname` companyname, `person`.`firstname` firstname, `person`.`lastname` lastname, `email`.`emailaddress` emailaddress, `address`.`state` state
FROM `contact`
INNER JOIN `person` ON `person`.`id` = `contact`.`person_id`
INNER JOIN `email` ON `email`.`id` = `person`.`primaryemail_email_id`
INNER JOIN `address` ON `address`.`id` = `person`.`primaryaddress_address_id`
WHERE (
(
`contact`.`state_contactstate_id` != ‘7’
)
OR (
`contact`.`state_contactstate_id` != ‘8’
)
) limit 900 offset 0