嗨,我需要一些帮助,我有一张表出售如下..我想将其与自身进行比较并显示公司不应等于公司且价格应等于价格的结果..我在 mysql 中尝试了许多查询,但是没有得到想要的结果,请帮我做到这一点!告诉正确的查询将非常感谢你们!
sells(company,drink,price)
我试过的查询
mysql>'select company,drink,price from sells JOIN s ON(price=price1) where (comp
any1!=company);'
而 s 是销售的副本表
+----------------+----------------+-------+
| company | drink | price |
+----------------+----------------+-------+
| PepsiCo | Mirinda | 45 |
| PepsiCo | Pepsi | 45 |
| Coca-Cola | Coca-cola zero | 45 |
| Nestle | Nescafe | 35 |
| Nestle | Nescafe | 35 |
| Nestle | Nescafe | 35 |
| Nestle | Nescafe | 35 |
| Nestle | Nescafe | 35 |
| Nestle | Nescafe | 35 |
| Coca-Cola | Coca-cola zero | 45 |
| Shezan | Twister | 25 |
| Nestle | Fruita vitals | 25 |
| Murree Brewery | Big Apple | 35 |
| Murree Brewery | Big Lemon | 35 |
| Murree Brewery | Big Orange | 35 |
| Murree Brewery | Peach Malt | 35 |
| Murree Brewery | Lemon Malt | 35 |
| Murree Brewery | Apple Malt | 35 |
+----------------+----------------+-------+