当我排除IN
子句或前面的条件时,查询有效,但是当我这样运行时它不起作用:
SELECT * FROM Widgets WHERE wdg_weight >= 1
AND wdg_weight <= 22
AND wdg_length >= 1
AND wdg_length <= 22
AND wdg_ports <= 3
AND wdg_ports >= 5
AND wdg_function = 'Primary'
AND IN ('Black','Blue')
我收到一个语法错误缺少操作符错误,它在错误消息中显示整个查询.... 请指出我在哪里犯错误
答案 0 :(得分:0)
在使用IN子句给出条件时,您应该指定IN子句应该在数据库的哪一列
例如:
Select * from students
where name IN ('John','Jim')