Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created July 1, 2014 13:38
Show Gist options
  • Save Altreus/9dbd05de050cc7295ff2 to your computer and use it in GitHub Desktop.
Save Altreus/9dbd05de050cc7295ff2 to your computer and use it in GitHub Desktop.
DELETE
sip
FROM
search_index_products sip
JOIN products p ON sip.productId=p.productId AND (sip.countryId=p.countryId OR (p.countryId=? AND p.productId NOT IN (SELECT productId FROM
products WHERE countryId=?)))
WHERE
p.refreshCache=1
AND sip.countryId=?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment