Code:
SELECT
product_name, model_year, list_price, COUNT(product_name) AS QUANTITY
FROM
[production].[products]
GROUP BY
model_year, list_price, product_name
HAVING
COUNT(product_name) > 1
ORDER BY
product_name DESC
I created this SP to make it easy
EXEC SP_CheckQuantity
I want to create a alert that runs every hour and then IF there is a value greater than 5 send me an email
Thank you