Created
May 20, 2016 09:54
-
-
Save MPJHorner/f1e541253bfd2ab70436f020d9a88e4b to your computer and use it in GitHub Desktop.
Find Pricelist Duplicates Report - Khaos Control (Keystone Software)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
sd.compclass_id as 'Pricelist ID', | |
cc.short_desc as 'Pricelist', | |
UPPER(st.stock_code) as 'SKU' | |
FROM struc_discounts AS sd | |
LEFT JOIN stock as st | |
ON sd.stock_id = st.stock_id | |
LEFT JOIN company_class as cc | |
on cc.compclass_id = sd.compclass_id | |
GROUP BY | |
sd.compclass_id, | |
cc.short_desc, | |
st.stock_code | |
HAVING (count(st.stock_code) > 1 ) | |
ORDER BY | |
sd.compclass_id, | |
st.stock_code | |
asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment