Secciones

Look for value in a comma separated list field in MySql

Inicio » Artículos » Look for value in a comma separated list field in MySql
La categoría del artículo es
Escrito el 22 September 2015, 12:49


If you have a field formatted as a comma separated list in MySQL and you need to search for those records containing a value in this field, you can use the method find_in_set.


If you have a field formatted as a comma separated list in MySQL and you need to search for those records containing a value in this field, you can use the method find_in_set.

This method returns the index position (starting by 1) where the value was found in the comma separated list field. This is an example:

Mysql:
 


Espero tus comentarios...

your_ip_is_blacklisted_by sbl.spamhaus.org.