You are looking for a mysql query to get the value of the column other than the same row


Looking for mysql query to get the column value other than except same row

Mike  15
Bob   16
Bunny 60
Mike  20
Bob   15
Bunny 20

Output Should be in below format:


Mike   16
Mike   60
Bob    20
Bob    60
Bunny  15
Bunny  16

Very strange request. Here is one method that should work for the data in your question:

select t.user, group_concat(t2.value order by t2.value)
from t join
     t t2
     on t2.user <> t.user
group by t.user;