LIKE

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
wvoyance
Forum Contributor
Posts: 135
Joined: Tue Apr 17, 2012 8:24 pm

LIKE

Post by wvoyance »

In SELECT-FROM-WHERE xx LIKE yy
Are there only two wild character % and _ ?

Is this standard usage?

I am somewhat surprised, since there is regular expression used everywhere, why not use regular expression here?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: LIKE

Post by Christopher »

Most databases also support regular expressions. So you can use either. The LIKE syntax is simpler, but perhaps following the 80/20 rule works most of the time.
(#10850)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: LIKE

Post by requinix »

MySQL has a simple LIKE and a more powerful REGEXP (aka RLIKE). SQL Server has an enhanced LIKE but no regular expressions.

But to answer the question, yes: LIKE is defined to support at least % and _.
Post Reply