🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database.dotnet
Article #607

Re: SQL Select with *name* search

#607
From: Wayne Niddery [TeamB]
Date: Sun, 07 Nov 2004 17:59
26 lines
2067 bytes
Hans wrote:
> I like to select based on a part of the nametext in SQL database
> fields. With the SQL select you can something like:
>
> Select * From persons where name>=@name
> parameters  @name = 'Jack'
>
> But I like to do a Select with
>
> Select * From persons where name=@name
> parameters  @name = '*ack*'
>
> Is that possible? With the LIKE it doesn't work.

 Select * From persons where name like @name
 parameters  @name = '%ack%'

'%' is the standard wildcard in SQL for matching 0..n characters. '_' is the 
standard for single character wildcards.

-- 
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"The moment the idea is admitted into society that property is not as
sacred as the laws of God and there is not a force of law and public
justice to protect it, anarchy and tyranny commence." - John Adams 
Technical Details
Message-ID: <418e62a0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <418df585@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,358a64acbbbea008
X-Google-Attributes: gid1effe6,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
From: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
Newsgroups: borland.public.delphi.database.dotnet
References: <418df585@newsgroups.borland.com>
Subject: Re: SQL Select with *name* search
Date: Sun, 7 Nov 2004 12:59:58 -0500
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.17.156.109
Message-ID: <418e62a0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1099850400 69.17.156.109 (7 Nov 2004 10:00:00 -0700)
X-Authenticated-User: wniddery
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail