Syntax error while appending string separated by commas in mysql

后端 未结 3 1511
后悔当初
后悔当初 2021-01-25 22:31

I have following query

SELECT diamondsList.*, dealers.* FROM diamondsList JOIN dealers ON diamondsList.dealerId = dealers.id WHERE price >= :minPrice AND pric         


        
3条回答
  •  太阳男子
    2021-01-25 23:06

    Your string values must be in quotes:

    IN (SI2,VS1,SI1,VS2,VVS2,VVS1,IF,FL)
    

    should be

    IN ('SI2','VS1','SI1','VS2','VVS2','VVS1','IF','FL')
    

    This applies to all of the strings in your query (i.e. check your other IN() statements)

提交回复
热议问题