Question: I want to execute a query where I can find one ID in a list of ID.

table `user` 

```
id_user | name  | id_site
-------------------------
1       | james | 1, 2, 3 
1       | brad  | 1, 3 
1       | suko  | 4, 5

```

and my query (doesn't work)

```
SELECT * FROM `user` WHERE 3 IN (`id_site`) 

```

This query work (but doesn't do the job) 

```
SELECT * FROM `user` WHERE 3 IN (1, 2, 3, 4, 6) 

```

Answer: 
**NO!** For relation databases

Your table doesn't comfort [first normal form](http://en.wikipedia.org/wiki/First_normal_form) (*"each attribute contains only atomic values, and the value of each attribute contains only a single value from that domain"*) of a database and you:

* use string field to contain numbers
* store multiple values in one field

To work with field like this you would have to use [`FIND_IN_SET()`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set) or store data like `,1,2,3,` (note colons or semicolons or other separator in the beginning and in the end) and use `LIKE "%,7,%"` to work in every case. This way **it's not possible to use indexes**[[1]](http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html)[[2]](http://bugs.mysql.com/bug.php?id=37564).

[Use relation table to do this](http://en.wikipedia.org/wiki/First_normal_form#A_design_that_complies_with_1NF):

```
CREATE TABLE user_on_sites(
    user_id INT,
    site_id INT,
    PRIMARY KEY (user_id, site_id),
    INDEX (user_id),
    INDEX (site_id)
);

```

And [join tables](http://www.w3schools.com/sql/sql_join.asp):

```
SELECT u.id, u.name, uos.site_id
FROM user_on_sites AS uos
INNER JOIN user AS u ON uos.user_id = user.id
WHERE uos.site_id = 3;

```

This way you can search [*efficiently*](http://www.mysqlperformanceblog.com/2012/11/23/full-table-scan-vs-full-index-scan-performance/) [using indexes](http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html).
The problem is that you are searching within several lists. 

You need something more like:

```
SELECT * FROM `user` WHERE id_site LIKE '%3%';

```

However, that will also select 33, 333 and 345 so you want some more advanced text parsing.