开发者

FIND_IN_SET in mysql

开发者 https://www.devze.com 2023-01-23 06:44 出处:网络
Hey, I just want to know开发者_开发技巧 if it\'s ok to do this: SELECT * FROM `table1` WHERE FIND_IN_SET(\"value1\", `field1`)

Hey, I just want to know开发者_开发技巧 if it's ok to do this:

SELECT * FROM `table1` WHERE FIND_IN_SET("value1", `field1`)

as opposed to this:

SELECT * FROM `table1` WHERE FIND_IN_SET("value1", `field1`) > 0


Yes, that's fine. If it finds the value, then the result will be greater than 0, which MySQL will interpret as TRUE.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号