简体   繁体   English

使用SQLite LIKE子句

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM