drop table if exists table1;
create table table1(
  u_id int,
  u_value varchar(100)
);
drop table if exists table2;
create table table2(
p_value varchar(100)
);insert into table1( u_id, u_value)
select 1, '135,178,129,135,241' union ALL
select 2, '120,121,137' union all 
select 3, '156,131,134,123,134' union all
select 4, '100,200';INSERT into table2( p_value )
select 135 union all
select 121 union ALL
select 156 union all
select 131;select *, count(*) 
from table1 as a 
left join table2 as b on instr( CONCAT( ',', a.u_value, ',' ), CONCAT( ',', b.p_value, ',' ) ) > 0
group by u_value;