Postgres中LIKE和〜之间的区别 [英] Difference between LIKE and ~ in Postgres
本文介绍了Postgres中LIKE和〜之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
已指示我不要打扰LIKE
",而应使用~
. LIKE
怎么了?~
有什么不同?
I've been instructed "not to bother with LIKE
" and use ~
instead. What is wrong with LIKE
and how is ~
different?
~
在这种情况下是否有名称,或者人们说使用波浪号运算符"?
Does ~
have a name in this context or do people say "use the tilde operator"?
推荐答案
~
是正则表达式运算符,并具有其隐含的功能.您可以指定完整的正则表达式通配符和量词;有关详细信息,请参见文档.它肯定比LIKE
更强大,应在需要此功能时使用,但它们具有不同的用途.
~
is the regular expression operator, and has the capabilities implied by that. You can specify a full range of regular expression wildcards and quantifiers; see the documentation for details. It is certainly more powerful than LIKE
, and should be used when that power is needed, but they serve different purposes.
这篇关于Postgres中LIKE和〜之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文