Returns a value 1 to N if the string str is in the list strlist consisting of N substrings. A string list is a string composed of substrings separated by `,' characters. If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic! Returns 0 if str is not in strlist or if strlist is the empty string. Returns NULL if either argument is NULL. This function will not work properly if the first argument contains a `,':

mysql> SELECT FIND_IN_SET('b','a,b,c,d');
-> 2

INSTR(str,substr)

Returns the position of the first occurrence of substring substr in string str. This is the same as the two-argument form of LOCATE(), except that the arguments are swapped:

thanks for your response. i tried your suggestion but i'm not sure it's what i'm looking for. ideally, i want to run a query that looks something like this:

select * from orders where find_in_set(41220, addresses)

addresses is the column that i want to search for the presence of 41220.

this obviously didn't work. anyone know of anything similar that might?

thanks,
mike

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by SepodatiCreations:Either of these should work:

FIND_IN_SET(str,strlist)

Returns a value 1 to N if the string str is in the list strlist consisting of N substrings. A string list is a string composed of substrings separated by `,' characters. If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic! Returns 0 if str is not in strlist or if strlist is the empty string. Returns NULL if either argument is NULL. This function will not work properly if the first argument contains a `,':

mysql> SELECT FIND_IN_SET('b','a,b,c,d');
-> 2

INSTR(str,substr)

Returns the position of the first occurrence of substring substr in string str. This is the same as the two-argument form of LOCATE(), except that the arguments are swapped:

Looking back...FIND_IN_SET should work if you put quotes around the number. you're looking for a string in a string...not an integer in a string... Did it give you an error or just not return any results?

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by SepodatiCreations:Or use instr(), it might be faster than using LIKE..

SELECT * FROM orders WHERE INSTR(addresses,'41220');

Looking back...FIND_IN_SET should work if you put quotes around the number. you're looking for a string in a string...not an integer in a string... Did it give you an error or just not return any results?