'Compare multiple columns from same table and only report if any of the columns have different values
Solution 1:[1]
We can use COUNT() as an analytic function:
WITH cte AS (
SELECT t.*, COUNT(*) OVER (PARTITION BY Price, Fromdate, Todate, Packsize) cnt
FROM yourTable t
)
SELECT StoreRegion, Itemid, Price, Fromdate, Todate, Packsize
FROM cte
WHERE cnt = 1;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tim Biegeleisen |


