select * from a inner join (select * form a group by x having count(x) > 1) on ???
select * from a inner join (select x,max(y) form a group by x) on ???
select case x when a then a1, when b then b1 end from xxxx
if(a>b,a,b)
ifnull(a,b)
select * from a inner join (select * form a group by x having count(x) > 1) on ???
select * from a inner join (select x,max(y) form a group by x) on ???
select case x when a then a1, when b then b1 end from xxxx
if(a>b,a,b)
ifnull(a,b)