Skip to content

Instantly share code, notes, and snippets.

@romikoops
Created October 7, 2014 19:31
Show Gist options
  • Save romikoops/d7fbc3f1ab7849f9899a to your computer and use it in GitHub Desktop.
Save romikoops/d7fbc3f1ab7849f9899a to your computer and use it in GitHub Desktop.
SELECT objects.name FROM objects JOIN object_types ON objects.object_type_id = object_types.object_type_id AND object_types.name = 'Building' WHERE NOT EXISTS (SELECT params.object_id FROM params, attributes WHERE objects.object_id = params.object_id AND attributes.attr_id = params.attr_id AND attributes.name = 'E-mail' AND params.text_value REGEXP '^[0-9a-zA-Z_\.\-]+@.*\.[a-z]+$')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment