我试图说明该事件是否有'%webinar%',名称中的'%network%'包括它“if”日期是在01-04-2015之后。我不能在单独的行上使用“或”,因为它忽略了日期。任何帮助赞赏。
select
,fsa.eventid
,sev.EventStart
from
event sev
on
sev.eventId = fsa.eventid
where sev.SNAP_EventStart >= '2015-04-01'
and eventidname in ('%webinar%','%network%')
答案 0 :(得分:2)
请尝试
... where sev.SNAP_EventStart >= '2015-04-01'
and (eventidname like '%webinar%' or eventidname like '%network%')
答案 1 :(得分:0)
试试这种方式
SELECT *
FROM table t INNER JOIN
(
SELECT '%webinar%' Col
UNION SELECT '%network%' col
) a ON t.COLUMN LIKE a.Col
答案 2 :(得分:-1)
试试这个。
select
,fsa.eventid
,sev.EventStart
from
event sev
on
sev.eventId = fsa.eventid
where sev.SNAP_EventStart >= '2015-04-01'
and
(
Patindex('%webinar%', eventidname) = 1
OR Patindex('%network%', eventidname) = 1
)