Hello

I've got a problem selecting values that match an option from a SET column.

My two columns are set up as follows:

         res_places      SET('North','West','South')
         res_places_re   SET('Aber','Cardiff','Bangor')

And I'm currently using the following MySQL query:

         SELECT * FROM gd_records WHERE (res_places & 3) AND (res_places_re 
& 1);

Which turns out very strange resutls.

What I'm trying to do (in english) is to select records from the database 
which matches option 3 in SET column res_places AND matches option 1 in SET 
column res_places_re.

For some reason my SQL query does not give me the desired results. I know 
that a record matches both these criteria but yet this omits that record 
when returning result.

Is the SQL query I am using correct? Is this the correct way of going about 
what I'm trying to do? I don't want to use FIND_IN_SET because I won't 
always know the SET option name to pass to FIND_IN_SET.

Thanks for your help.

Wiliam Stephens

Web Developer
http://www.fbagroup.co.uk


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to