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_re SET('Aber','Cardiff','Bangor')
And I'm currently using the following MySQL query:
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.
- wil
I've got a problem selecting values that match an option from a SET column.
My two columns are set up as follows:
Code:
res_places SET('North','West','South') res_places_re SET('Aber','Cardiff','Bangor')
And I'm currently using the following MySQL query:
Code:
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.
- wil