Select Distinct
SomeDay.SomeDayID, SomeDay.FolderName, SomeDay.FolderColor
from
SomeDay, SomeDayEvent
where
SomeDay.SomeDayID != 4,3,2,1;
答案 0 :(得分:5)
您不能将!=
用于您应使用not in
的多个值,如:
Select Distinct
SomeDay.SomeDayID,SomeDay.FolderName,SomeDay.FolderColor
from
SomeDay,SomeDayEvent
where
SomeDay.SomeDayID not in (4,3,2,1);
答案 1 :(得分:4)
您不能用逗号分隔WHERE部分中的值。您必须使用IN或BETWEEN关键字。
SomeDay.SomeDayID NOT IN (1,2,3,4)
或
SomeDay.SomeDayID NOT BETWEEN 1 AND 4
答案 2 :(得分:0)
Select Distinct SomeDay.SomeDayID,SomeDay.FolderName,SomeDay.FolderColor from SomeDay,SomeDayEvent where SomeDay.SomeDayID NOT IN (4, 3, 2, 1)
使用IN子句。
答案 3 :(得分:0)
SomeDayID
可以为空吗?你应该知道表达式
NULL NOT IN (1, 2, 3, 4)
未评估为TRUE。