Skip to content

Instantly share code, notes, and snippets.

@brandonweeks
Created November 10, 2015 09:20
Show Gist options
  • Save brandonweeks/b8a5f281cbce118724fa to your computer and use it in GitHub Desktop.
Save brandonweeks/b8a5f281cbce118724fa to your computer and use it in GitHub Desktop.
BEGIN;
DELETE
FROM nics
WHERE identifier LIKE 'tap%'
OR identifier LIKE 'qv%'
OR identifier LIKE 'qbr%';
DELETE
FROM fact_values
WHERE fact_name_id IN (SELECT id
FROM fact_names
WHERE name LIKE '%_tap%' OR name LIKE '%qv_%' OR name LIKE '%_qbr');
DELETE
FROM fact_names
WHERE id NOT IN (SELECT DISTINCT fact_name_id
FROM fact_values);
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment