Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save atme/39a6e293675df39b7422 to your computer and use it in GitHub Desktop.

Select an option

Save atme/39a6e293675df39b7422 to your computer and use it in GitHub Desktop.
Запрос находит записи с article_replaced is null, у которых нет записей с таким же артикулом, но заполненным полем.
SELECT an.article, ano.article
FROM atr_nomenclature an
LEFT OUTER JOIN atr_nomenclature ano ON an.article = ano.article AND ano.deleted = '0' AND ano.article_replaced is not null
WHERE an.deleted = '0' AND an.article_replaced is null AND an.article is not null AND ano.article is null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment