Please correct the query.
请正确的查询。
It is working but it gives the wrong result, I have database tables that look like this.
它是有效的,但是它给出了错误的结果,我有像这样的数据库表。
[3rdi_EventsRolePrice] :-EventID, RoleID, RolePrice
[3rdi_EventsRolePrice]:- FirstName, LaastName And EventID
I want to get FirstName
, LastName
, RoleID
by joining these two, and I am passing an event value as a parameter which is 13 in my case just for getting result.
我想通过加入这两个来获得FirstName, LastName, RoleID,我将一个事件值作为参数传递给它,在我的例子中,这个参数是13,只是为了获得结果。
SELECT ep.FirstName, ep.LastName, erp.RoleID
from [3rdi_EventParticipants] ep,[3rdi_EventsRolePrice] erp
WHERE ep.EventID==erp.EventID and erp.EventID='13'
I want to match where these two things "ep.EventID==erp.EventID" are equal, and their value is also 13. My query is also working syntaxically correct but I get a thoroughly wrong result.
我想匹配这两个东西的位置"ep.EventID= erp。EventID是相等的,它们的值也是13。我的查询在语法上也是正确的,但是我得到了一个完全错误的结果。
2 个解决方案
#1
3
SELECT
ep.FirstName,
ep.LastName,
erp.RoleID
FROM [3rdi_EventParticipants] ep
INNER JOIN [3rdi_EventsRolePrice] erp
ON ep.EventID = erp.EventID
WHERE erp.EventID='13'
I think it will work..
我想这行得通。
#2
1
ep.EventID==erp.EventID
to ep.EventID=erp.EventID
ep.EventID = = erp。EventID ep.EventID = erp.EventID
#1
3
SELECT
ep.FirstName,
ep.LastName,
erp.RoleID
FROM [3rdi_EventParticipants] ep
INNER JOIN [3rdi_EventsRolePrice] erp
ON ep.EventID = erp.EventID
WHERE erp.EventID='13'
I think it will work..
我想这行得通。
#2
1
ep.EventID==erp.EventID
to ep.EventID=erp.EventID
ep.EventID = = erp。EventID ep.EventID = erp.EventID