How to select code type 1900 and 1885 when exist at least one time per part ?
I work on sql server 2012 I face issue I can't select Parts from table tradesthat exist at least one time per for code type 1900 and 1885
so i need to make query select and get parts that
1- have code type 1885 or code type 1900 or both
2- if part id have code type 1885 or 1900 multiple time per part display it as part 20890
3- if code type have 1885 and have also code type 1995 not display part as 22390
4-if part have code type 1900 and code type 3400 not display part as 27981
what i tryselect * from #PartsTransactions where codetype in (1885,1900)but what i do on another case