SQL LIKE子句 [英] SQL LIKE Clause

查看:88
本文介绍了SQL LIKE子句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想搜索姓名,但是要删除小词,例如The,An,Or等,并搜索替代拼写,例如Color等。和颜色。这些单词位于表格中。


我可以使用方括号[...]搜索单个字符列表。我可以以某种方式合并IN列表吗?

LIKE"?[A,E,U] * [S,T]"返回第二个字母为A,E或U的所有位置。并且最后一个字母是S和S。或T。有没有办法用[颜色,颜色]代替最终的[S,T]?

I want to search for names, but eliminate the small words, such as "The", "An", "Or", etc., and search for alternate spellings such as "Color" and "Colour". These words are located in tables.

I can search for a list of single characters by using square brackets [...]. Can I somehow incorporate the IN list?
LIKE "?[A,E,U]*[S,T]" returns all where the second letter is an "A", "E", or "U" and the last letter is either an "S" or a "T". Is there a way to substitute [Color, Colour] for the final [S,T]?

推荐答案

我没有看到任何办法除了或者LIKE条件,因为[]运算符仅用于单个字符。

作为捷径,你可以这样做:

LIKE"?[AEU] * Colo * r"

严格要求你必须这样做:

LIKE"?[AEU] *颜色"或类似?[AEU] *颜色
I don''t see any way to do this other than OR together the LIKE conditions, since the [ ] operators are for single characters only.
As a shortcut you could do:
LIKE "?[AEU]*Colo*r"
To be strict you''d have to do:
LIKE "?[AEU]*Color" OR LIKE "?[AEU]*Colour"


单词Color。仅供参考。英国和美国英语之间有太多的替代拼写可以简单地处理。然后有三/ 3/ / III交替,和/和&提一些。在电影片名中,是空手道小子3,空手道小子III,还是......当非英语人士进入时,鸟名具有美国/英国对和普通拼写错误。

当鸟类名称在世界范围内被标准化为英语时,词语Common,Northern,European或Eurasian等。作为第一个词被添加到许多物种中,其中只有一种类型(Starling,Teal,Harrier)存在于英格兰,但这些名称与其他地方的限定词一起使用。美国有蓝翅,绿翅和肉桂青色。当欧洲人发布某些内容并希望将其标记为Teal时,他们知道他们需要限定符,因此他们选择一个。他们不使用它们,所以他们不记得哪个是正确的。

我认为Soundex功能是拼写错误和简单的拼写变化。毕竟,谁能正确拼写Vermillion的颜色呢?这不会处理Wigeon / Widgeon,同一只鸟的不同拼写,所以它就出来了。
The word "Color" was for illustration only. There are too many alternate spellings between British and American English to deal with simply. Then there is the Three/3/III alternates, and the And/& to mention a few. In movie titles, is it "Karate Kid 3", "The Karate Kid III", or ... Bird names have the American/British pairs and common misspellings when the entry is done by non-English speaking people.
When bird names were standardized worldwide for English, the words "Common", "Northern", "European", or "Eurasian" were added as a first word to many species where only one of the type (Starling, Teal, Harrier) exists in England but where these names are used with qualifiers elsewhere. USA has Blue-winged, Green-winged, and Cinnamon Teal. When Europeans post something and want to label it "Teal", they know that they need the qualifier, so they pick one. They don''t use them, so they can''t remember which is correct.
I''ve considered a Soundex feature for misspellings and simple spelling variations. After all, who can spell the color Vermillion correctly anyway? This would not handle Wigeon/Widgeon, different spellings for the same bird, so that is out.


我不确定你最初的目标是什么。你会保留一个每个单词的表格,它是另一种拼写吗?
I''m not sure what your original goal is. Would you keep a table of every word and it''s alternate spellings?


这篇关于SQL LIKE子句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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