Select by varchar column with IN() part in condition and int value returns all rows

后端 未结 4 2041
感情败类
感情败类 2021-01-24 02:14

Can someone explain me why with that query:

SELECT * FROM `tags` WHERE (tag IN (\'willa-lentza\', 2016))

it return me all rows from tags<

4条回答
  •  余生分开走
    2021-01-24 02:35

    My brief testing does not confirm this behavior.

    SELECT 'test' IN ('other-string', 2016) /* returns 0 */
    

    Not just any string should be able to match an integer. Are you sure you haven't changed anything else?

提交回复
热议问题