🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3467

Re: How to Search such record

#3467
From: Giuliano
Date: Fri, 02 Aug 2002 09:14
28 lines
1726 bytes
On Fri, 2 Aug 2002 16:50:31 +0800, "HuangC" <HuangC913@Msn.com> wrote:

>I want search in database that accord my request, I can do some simply
>query, now I want search the record that include a keyword in one field, not
>all the content of the field
>Can I use a SQL statement to query the accordant record.
>
>For example: suppose I have a Database that about pathology, I want search
>all the record that include 'cancer' in 'diagnose' field, It't include, not
>always all the content.

Try something like this:

SELECT * FROM PATHOLOGY
WHERE DIAGNOSE LIKE "%CANCER%"
OR DIAGNOSE LIKE "%ANOTHER_DISEASE%"
OR ... and so on

... or a "case insensitive" version:

SELECT * FROM PATHOLOGY
WHERE UPPER( DIAGNOSE ) LIKE "%CANCER%"
OR UPPER( DIAGNOSE ) LIKE "%ANOTHER_DISEASE%"
etc etc

Ciao!

Giuliano
Technical Details
Message-ID: <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mail
References: <3d4a47da$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,679d71d5dccfc870
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-08-02 02:20:55 PST
From: Giuliano <gcardinali@remove.adhoc.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: How to Search such record
Date: Fri, 02 Aug 2002 11:14:31 +0200
Message-ID: <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com>
References: <3d4a47da$1_2@dnews>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 194.183.77.198
X-Trace: dnews 1028279666 194.183.77.198 (2 Aug 2002 02:14:26 -0700)
Lines: 28
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mail