Skip to content

Instantly share code, notes, and snippets.

@teiling88
Created August 25, 2016 12:55
Show Gist options
  • Save teiling88/f742274aef6ab06020b996c807ec6411 to your computer and use it in GitHub Desktop.
Save teiling88/f742274aef6ab06020b996c807ec6411 to your computer and use it in GitHub Desktop.
-- find invalide seo urls with not existing articleIds
SELECT COUNT(*) FROM s_core_rewrite_urls scru
LEFT JOIN s_articles sa ON REPLACE(scru.org_path, 'sViewport=detail&sArticle=', '') = sa.id
WHERE scru.org_path LIKE 'sViewport=detail&sArticle=%'
AND sa.id IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment