Reputation: 2968
Lets assume I have this postgresql table:
product_id store_id price
How do I query "which products hasn't the same price on every store".
I mean, same value on product_id but distinct value on price.
Upvotes: 0
Views: 16
Reputation: 22063
SELECT product_id
FROM "ProductStore"
GROUP BY product_id
HAVING COUNT(DISTINCT price) > 1
Upvotes: 1