[thelist] SQL: Searching a field with mutiple names

Tab Alleman Tab.Alleman at RealMetros.com
Thu Aug 2 10:52:54 CDT 2001


but, but, but... ummm, 

are you sure you're supposed to use '%foo%' with LIKE?   I think it
might just be %foo%... if you put it in single-quotes, won't it
literally look for "%foo%"?  Or maybe it should be %'foo'%

grrrr, no sql reference handy.  sorry.

HTH
Tab

-----Original Message-----
From: Toivonen, Nicole [mailto:Nicole.Toivonen at crt.xerox.com]
Sent: Thursday, August 02, 2001 10:18 AM
To: thelist at lists.evolt.org
Subject: [thelist] SQL: Searching a field with mutiple names


She of the annoying SQL questions returns:

I'm trying to implement a database search, and am finding that I'm not
able
to come up with any records.

The databse is an authors database, and the search is mainly based on
the
user entering the name, or partial name in a text field.  Simple, yes?
Not so much, for me anyway.  The field being searched contains several
names, most of the time, since those wacky scientists tend to write
papers
together.  So, a given record could look like:

Toivonen, N; Loutfy, R; Smith, P

How do I then pull the 'Toivonen' records from the DB?  I'm sure I'm
missing
something.

LIKE '%Toivonen%'
LIKE 'Toivonen%'
and
LIKE 'Toivonen'

aren't working for me.

TIA!

Nicole,
who knows that, by now, she owes rudy at least two pints.

____________________________
Nicole Toivonen
Web Developer
Xerox Research Centre of Canada
nicole.toivonen at crt.xerox.com
+1-905-823-7091 ex. 305
Intelnet: 8*286-1305 

---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list