select gameid from (
select group_concat(type,"-",v) as final,gameid from 
(select gameid,type,v from (
select gameid,type, group_concat(value) as v from (
select * from table_name order by gameid asc,type asc,value asc
) as u where (type=1 and value in ('5','8')) or (type=2 and value in ('1')) group by gameid,type
) as tmp
) as t group by gameid 
) as f where final='1-5,8,2-1'

 

posted on 2017-07-18 10:57  人生旅途的人  阅读(293)  评论(0编辑  收藏  举报