我正在尝试添加一个 if 语句,例如如果标题是这样,则排除那些文件名,否则文件名 = bla bla。但显然不起作用,有什么想法吗?
SELECT
SUM(streamlength)
FROM
files,
filemetadata
where
files.id = filemetadata.id
AND title like 'abc'
and (Time > '2013-01-01' and Time < '2013-08-06' )
and
if((title like 'abc' AND Time > '2013-02-22'),
(filename NOT like '%20121129%'
AND filename NOT like '%20121204%'
AND filename NOT like '%20121214%'
AND filename NOT like '%20121219%'
AND filename NOT like '%20130109%'
AND filename NOT like '%20130114%'),filename like
'%1111111%')