我有两张桌子
第一张表:center
(2 列)
+-----------------------------------+
|id | company_name |
+-----------------------------------+
|2 | Skytel Outsourcing Pvt. Ltd. |
+-----------------------------------+
第二表:campaign_center
(3 列)
+-------------------------------------+
|campaign_id | Center_id | sl_no |
+-------------------------------------+
|Demo | 2 | 2 |
+-------------------------------------+
|MyFootPath | 2 | 3 |
+-------------------------------------+
当我执行此查询时,它运行良好:(查找center_id
和公司名称campaignid
是谁'Demo'
)
select center.id, center.company_name
from center
inner join campaign_center
on center.id = campaign_center.center_id
where campaign_center.campaign_id = 'Demo'
但是当我试图找到那些campaign_id
不是的公司时,'Demo'
它又没有给出正确的输出:
select center.id, center.company_name
from center
inner join campaign_center
on center.id = campaign_center.center_id
where campaign_center.campaign_id != 'Demo'
我如何得到那些?请帮忙。