sql - MySQL request WHERE ... IN -


In a table "partners", I have a field "sites" that can include values ​​like 1,27,38

Then, the website on which ID is N ° 27, I would like to receive the partners associated with this website.

I tried this: SELECT * FROM partners WHERE 27 IN (partners.sites)

This works if 27 is in the beginning of the string ( Example: 27,1,128), but if 27 is in the middle then it does not work (like: 1,27,38,12)

Do you have an idea of ​​managing it?

View Cyril

Find the manual for find_in_set


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -