On Sun, Feb 21, 2010 at 12:04 AM, Wally Kolcz wrote:
> I have a record where 'ageGroups' is '0, 1, 2, 3, 4, 5, 6, 7, 8' and the
> 'accountType' is 'kids, siblings, parents'
As other have said, your schema is all wrong. But for this simple
scenario it is doable to fix it with string manipulation:
Select *
FROM chatrooms
WHERE
',' || accountType || ',' LIKE <cfqueryparam
value="%,#arguments.accountType#,%">
AND
',' || ageGroups || ',' LIKE <cfqueryparam value="%,#arguments.ageGroup#,%">
ORDER BY roomDisplay ASC
You need to fix the || operator if you are not running MySQL in
standard compliance mode.
Jochem
--
Jochem van Dieten
http://jochem.vandieten.net/