附加图像是内部联接表。
我想在内部联接表中的标题、描述和公司名之间进行搜索。我不知道这个问题出了什么问题,请告诉我。
The results of table i'm searching on

SELECT campaign.name AS campaignTitle, campaign.desc AS campaignDesc,
users.name AS companyName
FROM campaign
INNER JOIN users
ON campaign.userId=users.id
WHERE campaign.name like '%"Mia"%'
OR campaign.desc like '%"dolo"%'
OR users.name like '%"iT"%'

我是做搜索功能的新手。有没有更有效的方法来执行这样的搜索?请告知。谢谢
更新
The result returns nothing from the query above

最佳答案

尝试:

SELECT campaign.name AS campaignTitle, campaign.desc AS campaignDesc,
users.name AS companyName
FROM campaign
INNER JOIN users
ON campaign.userId=users.id
WHERE campaign.name like '%Mia%'
OR campaign.desc like '%dolo%'
OR users.name like '%iT%'

删除双引号:
like '%"Mia"%'

关于mysql - 在内部连接表上搜索多个查询,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33072813/

10-13 04:24