Skip to content

Instantly share code, notes, and snippets.

@sdrwtf
Last active August 4, 2021 06:52
Show Gist options
  • Save sdrwtf/acdd6b3a5fff0a639a39bc00149fa6b3 to your computer and use it in GitHub Desktop.
Save sdrwtf/acdd6b3a5fff0a639a39bc00149fa6b3 to your computer and use it in GitHub Desktop.
Select all active articles in a Shopware 5.x database which have unsupported special characters in the ordernumber.
/*
Select all active articles in a Shopware 5.x database
which have unsupported special characters in the ordernumber.
(Supported special characters are: . - _)
*/
SELECT
sad.ordernumber,
sa.name AS 'ArticleName',
sa.active,
sas.name AS 'SupplierName'
FROM
s_articles sa
LEFT JOIN
s_articles_details sad
ON
sa.id = sad.articleID
LEFT JOIN
s_articles_supplier sas
ON
sa.supplierID = sas.id
WHERE
sa.active = 1
AND
sad.ordernumber REGEXP '[^a-zA-Z0-9\-\_\.]';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment