Article View: borland.public.cppbuilder.database.ado
Article #3473Re: How to Search such record
From: HuangC
Date: Sat, 03 Aug 2002 03:11
Date: Sat, 03 Aug 2002 03:11
42 lines
2314 bytes
2314 bytes
Hi Giuliano Thanks for your response, but I have not succeeded now, I try to use "LIKE" keyword according by your said, but It always find the records that included the appointed content at the front of appointed field. If the appointed content is at the middle or end of the field, it can not find it. Could you tell me a better way to do it, thanks in advance. "Giuliano" <gcardinali@remove.adhoc.net> wrote in message news:q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com... > 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:
<3d4b49fc$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mailReferences:
<3d4a47da$1_2@dnews> <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com>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 20:21:16 PST Reply-To: "HuangC" <HuangC913@msn.com> From: "HuangC" <HuangC913@Msn.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3d4a47da$1_2@dnews> <q3jkku0edmlan5gv4rjs41ir7of9jedme0@4ax.com> Subject: Re: How to Search such record Date: Sat, 3 Aug 2002 11:11:53 +0800 Lines: 44 Organization: Motic X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 NNTP-Posting-Host: 210.15.1.114 Message-ID: <3d4b49fc$1_2@dnews> X-Trace: dnews 1028344316 210.15.1.114 (2 Aug 2002 20:11:56 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!not-for-mail