希望有人可以给我一些指导。我的问题:
SELECT
wm.ID,
wm.name,
wm.meeting_type,
m.start_date,
wml.name as location
FROM
webmaster.meeting wm inner join meetings m on wm.ID = m.Meeting_Code
inner join webmaster.meeting_location on wml wm.locationID = wml.ID
WHERE
Year(m.start_date) = Year(getDate())
ORDER BY
m.start_date
运行时,我收到此错误:
Msg 4145, Level 15, State 1, Line 9
An expression of non-boolean type specified in a context where a condition is expected, near 'wm'.
我有什么遗失的吗?
答案 0 :(得分:5)
从
更改此内容inner join webmaster.meeting_location on wml wm.locationID = wml.ID
to
inner join webmaster.meeting_location wml on wm.locationID = wml.ID
答案 1 :(得分:0)
试试这个:
SELECT
wm.ID,
wm.name,
wm.meeting_type,
m.start_date,
wml.name as location
FROM
webmaster.meeting wm inner join meetings m on wm.ID = m.Meeting_Code
inner join webmaster.meeting_location wml on wm.locationID = wml.ID
WHERE
Year(m.start_date) = Year(getDate())
ORDER BY
m.start_date