Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        去年关闭。
                                                                                            
                
        
我有桌酒店。有多个列,但我想在过滤器列上应用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”附近使用

最佳答案

您可以尝试以下-

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');

关于mysql - mysql查询的IN子句,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54193392/

10-10 03:15