Page 1 of 1

LIKE

Posted: Fri Jul 20, 2012 7:40 am
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?

Re: LIKE

Posted: Fri Jul 20, 2012 4:24 pm
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.

Re: LIKE

Posted: Fri Jul 20, 2012 9:00 pm
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 _.