问题描述
专家,
在我的 Nridubai.com 网站中,
我正在根据事件搜索查询.查询与1个或多个事件相关.
有两个表 inquiry(inquiry_id,comapnyname,category,..)和 inquiry_event(id,inquiry_id,event_id).
我将所有查询信息存储在查询表中.
并且每个与查询相关联的事件(可能是一个或多个)都存储在次要表 inquiry_event 表中.
现在,当我要基于加入(有用的/内部加入的或左加入的)事件进行搜索查询时?
目前,我正在使用内部联接正常工作.
例如.
Hi Expert,
In My Nridubai.com website,
I am searching inquiries based on event. inquiry is associated with 1 or more events.
There are 2 tables inquiry(inquiry_id,comapnyname,category,..) and inquiry_event(id,inquiry_id,event_id).
I store all inquiry information in inquiry table.
and each inquiry associated event(may be one or more) storing in secondory table inquiry_event table.
now when i want to search inquiry based on event which join in useful / Inner Join or left join ?
Currently i am using inner join working fine .
eg.
select * from inquiry inq INNER JOIN inquiry_event inqevent ON inq.inquiry_id=inqevent .inquiry_id
WHERE inqevent.event_id=10
现在我可以在这里使用左联接吗?
请帮帮我.
Now here can i use left join ?.
Please Help me.
thanks in advance.
推荐答案
这篇关于何时使用内部联接,何时使用左联接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!