I work on sql server 2012 I need to make select query display parts have duplicate on code type and different on code
CREATE TABLE #Trades
(
PartId int,
CodeTypeId int,
Code Int
)
insert into #Trades(PartId,CodeTypeId,Code)
values
(1215,1220,250),
(1215,1220,110),
(1350,1220,330),
(1350,1220,900),
(4521,2500,700),
(4521,2500,800),
(4521,2500,950),
(3500,2900,230),
(3500,2900,230),
(5400,1220,230),
(5400,1220,230)
expected result
expected result text as image above
PartId CodeTypeId Code
1215 1220 250
1215 1220 110
1350 1220 330
1350 1220 900
4521 2500 700
4521 2500 800
4521 2500 950