Skip to content

Instantly share code, notes, and snippets.

@ianlandsman
Created September 4, 2012 23:33
Show Gist options
  • Save ianlandsman/3628071 to your computer and use it in GitHub Desktop.
Save ianlandsman/3628071 to your computer and use it in GitHub Desktop.
HelpSpot custom SQL for searching email headers
Something like this should work. Note, this will be very heavy on the DB so I wouldn't recommend enabling counts on the filter unless you know your DB server has the horsepower.
Also the info inside tEmailHeaders is serialized PHP, it's not really designed to be searched so double quotes are escaped. There could be some other things along those lines that might trip you up as well.
xRequest NOT IN (SELECT xRequest FROM HS_Request_History WHERE tEmailHeaders LIKE "%campaignmonitor.com%")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment