String operator like

by Irina 28. March 2009 15:16

The Like operator implements pattern matching for strings of character data.

The operator requires two parameters: a string expression to be searched and a string pattern to search for.

The string pattern may contain specific characters, as well as the following wildcards:

 

%= zero or more character positions

_= one character position

 

String pattern examples:

 

LIKE ‘IRE%’ – begins with ‘IRE’

LIKE ‘%IRE%’ - contains ‘IRE’ anywhere

Like ‘_IRE’ – contains IRE in the last three positions

LIKE ‘%I_’ – contains I in the next to last position

 

Example

 

Select first_name, last_name

From   customers

Where last_name like ALL (‘%K%’,’%J%’)


Quantifiers:

 

ANY = any single condition must be met (or)

SOME = same as any
ALL = all conditions must be met (and)

 

LIKE with ESCAPE character.

 

The ESCAPE feature of LIKE permits wildcard characters to be treated as non-wildcards.

Characters following the escape character are not treated as wildcards.

 

Example

 

Select campaign_name

From   customers

Where campaign_name like ‘_H_%’  escape ‘H’

 

Campaign_name

A_new_year

B_new_client

A_saving_account_805

 

Related posts

Comments

8/8/2011 12:47:18 AM

I am happy to find so many useful information here in the post, thanks for sharing it here. I hope you will adding

more...THANK YOU!

Christian Louboutin

8/8/2011 12:47:48 AM


This site is very meritorious and detestable,I appreciate!THANK YOU!

thomas sabo sale

8/8/2011 12:48:09 AM

Your article is quite uplifting,I wish you continued results in creating.THANK YOU!

Thomas Sabo Charms

8/8/2011 12:48:36 AM

This is my first post. I really like this blog. I’m reading this post from my I-Phone and it looks great!THANK YOU!

Pandora Beads

8/8/2011 12:48:57 AM

It's okay... love looking at your lovely post.THANK YOU!
Not much words needed, really.THANK YOU

Pandora Charms

11/29/2011 10:50:36 AM


SEO (SEO Company London) has now become a popular way for success of each online business. The SEO procedure is helpful for taking a website in the top position in major search engines such as google, bing and yahoo. Individuals from all over the globe prefer SEO India as India companies offer high quality and cost effective services.


SEO (SEO Company London) has now become a popular way for success of each online business. The SEO procedure is helpful for taking a website in the top position in major search engines such as google, bing and yahoo. Individuals from all over the globe prefer SEO India as India companies offer high quality and cost effective services.

http://www.seosoftwareservices.com

SEO Company India

Add comment


(will show your Gravatar icon)  





Live preview

2/5/2012 8:55:30 PM

 

About the author

Irina Spivak Irina Spivak
Team Leader at G-Stat. More...


Send mail Email

Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    Sign in

    eXTReMe Tracker