Skip to content

Instantly share code, notes, and snippets.

@edersqo
Created April 11, 2018 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edersqo/aadfcd4bbd9bdbc3e382e03915665900 to your computer and use it in GitHub Desktop.
Save edersqo/aadfcd4bbd9bdbc3e382e03915665900 to your computer and use it in GitHub Desktop.
Gets all Prices Stored at DCS_PRICE, and checks if it is the one -- pointing to the publishing schema.
SELECT
*
FROM
(
SELECT PRICE_LIST, SKU_ID, COUNT(*)
FROM WLM_PROD_CATA.DCS_PRICE
GROUP BY
PRICE_LIST, SKU_ID
HAVING
COUNT(*) > 1
) CATA_PRICE
LEFT JOIN
(
SELECT
IS_HEAD,
VERSION_DELETED,
CHECKIN_DATE,
PRICE_ID,
PRICE_LIST,
SKU_ID
FROM WLM_PROD_PUB.DCS_PRICE
) PUB_PRICE
ON
CATA_PRICE.PRICE_LIST = PUB_PRICE.PRICE_LIST
AND CATA_PRICE.SKU_ID = PUB_PRICE.SKU_ID;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment