I have a table that has duplicate data. A field in the table has some typo's so I am trying to find all the rows in this table where the other column does not have the same information.
For example
partnumber
warehouse int_pn ext_pn
========= ====== ======
1 ABC100 XYZ001
2 ABC100 XYZ001
1 ABC200 XYZ021
2 ABC200 XYY021
3 ABC999 XYZ999
In the table above, int_pn ABC200 exists in two warehouses (1 and 2) but in ext_pn for warehouse 2 there is a typo
I am trying to list all the rows where int_pn appears more than once but have a different ext_pn
http://sqlfiddle.com/#!6/96248d/1
The result of a query should return
result
warehouse int_pn ext_pn
========= ====== ======
1 ABC200 XYZ021
2 ABC200 XYY021
I am having a hard time building a SQL query to do this
Thanks