mysql查询的IN子句

时间:2019-01-15 05:53:57

标签: mysql

我有桌酒店。有多个列,但我想在过滤器列上应用In子句,但发生错误。提供解决方案。

查询是

Select * 
from hotel inner 
join hoteltype on hotel.type_id=hoteltype.id inner 
join area on hotel.area_id=area.id 
where area.area='Shivaji Chowk' 
and type='Restaurant' 
and filter In(Deals,Online Payment available,Pure Vegetarian );

错误是

1064-您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册以获取正确的语法,以在第1行“可用付款,纯素食)LIMIT 0,25”附近使用

1 个答案:

答案 0 :(得分:1)

您可以在下面尝试-

Select * from hotel inner join hoteltype on hotel.type_id=hoteltype.id 
inner join area on hotel.area_id=area.id 
where area.area='Shivaji Chowk' and type='Restaurant' and filter In
('Deals','Online Payment available','Pure Vegetarian');