MySQL WHERE IN ()

后端 未结 3 1349
感情败类
感情败类 2020-11-28 07:31

My query is:

SELECT * FROM table WHERE id IN (1,2,3,4);

I use it for usergroups and a user can be in more than one group. but it seems that

3条回答
  •  无人及你
    2020-11-28 08:35

    you must have record in table or array record in database.

    example:

    SELECT * FROM tabel_record
    WHERE table_record.fieldName IN (SELECT fieldName FROM table_reference);
    

提交回复
热议问题