Unix Technical Forum

Using like predicate

This is a discussion on Using like predicate within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, i want to search record in a table where a varchar column is equal to a word or ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 03:37 AM
Benoit Le Goff
 
Posts: n/a
Default Using like predicate

Hi,
i want to search record in a table where a varchar column is equal to
a word or this word with the letter 's' or this word with the letter
'e'.
Today, i've this query :

select * From Table Where Column = 'Word' or Column like 'Word[es]'

I want to remove the 'or' of this query to have only one condition.
Does someone know a solution to my problem.

Excuse my poor english language.
I hope you understand my problem and thks for solution.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 03:37 AM
Oscar Santiesteban Jr.
 
Posts: n/a
Default Re: Using like predicate

Have you tried,
select * from Table where column like 'Word%'

This will select any record where the column starts with Word and anything
after that.

Oscar...

"Benoit Le Goff" <begoo@caramail.com> wrote in message
news:b4eb6433.0407150754.bfa2c00@posting.google.co m...
> Hi,
> i want to search record in a table where a varchar column is equal to
> a word or this word with the letter 's' or this word with the letter
> 'e'.
> Today, i've this query :
>
> select * From Table Where Column = 'Word' or Column like 'Word[es]'
>
> I want to remove the 'or' of this query to have only one condition.
> Does someone know a solution to my problem.
>
> Excuse my poor english language.
> I hope you understand my problem and thks for solution.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 03:38 AM
Benoit Le Goff
 
Posts: n/a
Default Re: Using like predicate

I don't want Word with anything after, i just want Word with e or s,
only that. So i can't use the %.

Thks for your help.

"Oscar Santiesteban Jr." <oscarsantiesteban@worldnet.att.net> wrote in message news:<ElGJc.261123$Gx4.184747@bgtnsc04-news.ops.worldnet.att.net>...
> Have you tried,
> select * from Table where column like 'Word%'
>
> This will select any record where the column starts with Word and anything
> after that.
>
> Oscar...
>
> "Benoit Le Goff" <begoo@caramail.com> wrote in message
> news:b4eb6433.0407150754.bfa2c00@posting.google.co m...
> > Hi,
> > i want to search record in a table where a varchar column is equal to
> > a word or this word with the letter 's' or this word with the letter
> > 'e'.
> > Today, i've this query :
> >
> > select * From Table Where Column = 'Word' or Column like 'Word[es]'
> >
> > I want to remove the 'or' of this query to have only one condition.
> > Does someone know a solution to my problem.
> >
> > Excuse my poor english language.
> > I hope you understand my problem and thks for solution.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com