In MySQL database, I have a products table containing various product data, including company.
| id | name | company |
|---|---|---|
| 1 | Product 1 | AAA |
| 2 | Another product | BBB |
| 3 | One more product | CCC |
| 4 | Item ZZZ | BBB |
| 5 | Product A | AAA |
| 6 | Product uT | DDD |
| 7 | Product 2z | AAA |
Now I want to build a query which will select all products which have a unique company - I mean a company, which appears only once in the whole table. In the above example - row 3 with company CCC and row 6 with company DDD.
How can I achieve this?