[英]Using the SQLite LIKE clause
Kindly review this simple SQLite-fiddle . 请查看此简单的SQLite-fiddle 。
If any word in the column ITEM
of table TWO
matches any word in the column NAME_2
of table ONE
, there should be a result(s). 如果表TWO
的列ITEM
中的任何单词与表ONE
的列NAME_2
中的任何单词匹配,则应该有一个结果。
Tried many permutes, yet not sure how to form the query for achieving this. 尝试了许多排列,但不确定如何形成查询以实现此目的。 Should the GLOB
clause be used instead of LIKE
, or perhaps some other wildcard patterns? 应该使用GLOB
子句代替LIKE
还是其他通配符模式?
Many thanks in advance! 提前谢谢了!
As per my comment, I think you can make use of instr
as well. 根据我的评论,我认为您也可以使用instr
。 For example: 例如:
SELECT * FROM Table1 T1, Table2 T2 where instr(T2.NAME_2,T1.ITEM);
The above should return rows where T2.NAME contains a string = T1.ITEM 上面的应该返回其中T2.NAME包含字符串= T1.ITEM的行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.