.... -> Mohit Agarwal wrote: > > On Mon, Dec 10, 2001 at 02:04:59PM +0000, Wiliam Stephens wrote: > > I want to select a few records from a database, but I'm having trouble > > pinning down the correct method for my SQL call. > > > > I have a SET field with the following options: > > > > 'Wales','Mid Wales','North Wales','South Wales','West > > Wales','Towns & Cities in Wales' > > > > I want my search program to search for a record that has is in 'Wales'. > > However, when I try: > > > > res_place LIKE '%Wales%' > > > > That returns all records that are in 'Wales','Mid Wales','North Wales' and > > so forth. > > > > So how do I create a SQL call that will match the option 'Wales' and > > nothing else? > > There are 2 options: > > 1. RTFM > 2. Find an appropriate list. IMO this doesn't pertain to perl dbi at > all, read the faq. The most elementary faq shouldn't be more than > enough for you. > > HTH and take care!
1. I don't know if I associated the right words to RTFM, but I'm quite sure yes.. heheheh If you use mySQL you will see in the F Manual that LIKE is for pattern matching, and you can also use REGEXP function. "Note that you do not use = or != when you use SQL patterns; use the LIKE or NOT LIKE comparison operators instead." In your case you can use "=" or like without any wildcards. 2. [EMAIL PROTECTED] if you are with mySQL. they answer this type of question everyday even if it's in the FM. You can use a mailinglist for your database or for general SQL. Etienne -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001
