mysql - WHERE IN - must meet all params -


i'm conducting in query.

here's query:

select * `xh_user`  (select count(*)         `xh_roles`         inner join `xh_role_user` on `xh_roles`.`id` = `xh_role_user`.`role_id`         `xh_role_user`.`user_id` = `xh_user`.`id`         , `title` in (?, ?)) >= 1  , `id` = ? limit 1' 

i'm searching rows title meets params.

rows come if 1 of params met.

how can make params must met?

assuming have 2 parameters:

select * `xh_user`  (select count(distinct title)         `xh_roles` inner join             `xh_role_user`             on `xh_roles`.`id` = `xh_role_user`.`role_id`         `xh_role_user`.`user_id` = `xh_user`.`id` ,              `title` in (?, ?)       ) = 2 ,       `id` = ? limit 1; 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -