I have been investigating this topic but it is not quite what I need and I do not understand how to solve it.
Table: companies
Columns: id, cust_number, cust_name
There may be many records with the same cust_number, but all such records should have identical cust_name.
The query I am trying to write should display all records where this is not the case - like this:
| id | cust_number | cust_name |
| -- | ----------- | --------- |
| 10 | 800 | Acme LTD |
| 11 | 700 | Globex |
| 12 | 800 | Acme LTD |
| 13 | 444 | Globex |
| 14 | 800 | Acme LTT |
From the table above the query should result in:
| id | cust_number | cust_name |
| -- | ----------- | --------- |
| 10 | 800 | Acme LTD |
| 12 | 800 | Acme LTD |
| 14 | 800 | Acme LTT |
Because there are more than 1 records with the same cust_number but all 3 records does not have identical cust_name.
Thanks for all help!