On 24-Mar-2003 Daniel Rossi wrote:
> hi there i have a field which i place comma delimitered id's like so 
> 
> 64,14,13,15
> 
> these are site id's which i check against a user who has access, i also
> use it to check if to show a banner on a particular site, although
> further checking showed that say i did a select * from table where
> sites_access IN (4) it will still pick up the 4 in both 64 and 14 , is
> there are way to get an exact match of 4 ?
> 
> so it would return true if i had it like this 64,14,13,15,4
> 
> 

mysql> SELECT FIND_IN_SET(4, '64,14,13,15,4');
+---------------------------------+
| FIND_IN_SET(4, '64,14,13,15,4') |
+---------------------------------+
|                               5 |
+---------------------------------+
1 row in set (0.01 sec)

mysql> SELECT FIND_IN_SET(4, '64,14,13,15');  
+-------------------------------+
| FIND_IN_SET(4, '64,14,13,15') |
+-------------------------------+
|                             0 |
+-------------------------------+


Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to