I have a table products, one specific product may contain different models, model 0 represents basic model:
Select *
From products
Where product_number = 12345;
Result:
id made_by product_number model
----------------------------------
122 U123 12345 0
123 U123 12345 1
124 U552 12345 2
Now I would like to find only these products where basic model (model=0) made_by value differs in some model?
In this example I am definitely interested in to have this product 12345 in results.
On thing what came to my mind is to select distinct and count, but maybe there are better ways?