在SQLite中替代FIND_IN_SET? [英] Alternative to FIND_IN_SET in SQLite?

查看:1349
本文介绍了在SQLite中替代FIND_IN_SET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mysql中,FIND_IN_SET用于查找集合中的值.我在SQLite中尝试了FIND_IN_SET,但是它不是SQL关键字.我已经用Google搜索,但是没有得到答案.如果有人知道,请告诉我SQLite中FIND_IN_SET的替代方法.

In Mysql, FIND_IN_SET is used to find value in a set. I have tried FIND_IN_SET in SQLite, but it is not an SQL keyword. I have Googled, but I did not get an answer. If anybody knows, please tell me the alternative to FIND_IN_SET in SQLite.

推荐答案

如果只需要true/false值而不是索引,则可以使用LIKE子句:

If you need just a true / false value rather than index then you can use LIKE clause:

(',' || column_name || ',') LIKE '%,value,%'

这篇关于在SQLite中替代FIND_IN_SET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆