I have a table that includes these columns:
Nameplate
Model
Segment
A sample table looks like:
Nameplate Model Segment
Acura ILX Small Lux Car
Audi Q5 Compact Lux Car
Audi Q5 Mid Lux Car
Audi SQ5 Compact Lux Car
I need to find all Nameplate, Model combinations with multiple Segments.
In the above table, I need it to return:
Audi Q5 Compact Lux Car
Audi Q5 Mid Lux Car
I thought the following would work:
SELECT DISTINCT
[Nameplate], [Model], [Segment]
FROM
dbo.[Weighted Extract]
GROUP BY
[Nameplate], [Model], [Segment]
HAVING
COUNT([Segment]) > 1;
The above code only returns combinations with multiple Nameplate, Model, and Segment rows. This should be easier than I am making it, but I'm stuck.