[英]Using SQL is it possible to search via string without regards to the order of the characters?
I would like to be able to search using a sql query without regarding the order of the characters within a string: 我希望能够使用sql查询进行搜索,而无需考虑字符串中字符的顺序:
the search for 'black box' 搜索“黑匣子”
should return 'box black 32oz 2 pack', 'box black 32oz 4 pack' 应返回“盒装黑色32盎司2包”,“盒装黑色32盎司4包”
currently it does not return any of it. 当前它不返回任何信息。
I must search by 'box black' to receive a query result 我必须按“黑匣子”进行搜索才能收到查询结果
SELECT DISTINCT Hetype.Description,
Item.Type
FROM Item
INNER JOIN Hetype ON Item.Type = Hetype.Type
WHERE Hetype.Description LIKE '%black box%' IGNORE CASE
You can use two LIKE
expressions: 您可以使用两个LIKE
表达式:
WHERE Hetype.Description LIKE '%black%' IGNORE CASE AND
Hetype.Description LIKE '%box%' IGNORE CASE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.