SELECT GREATEST( sender_id, recipient_id ) , LEAST( sender_id, recipient_id ) , COUNT( * ) AS a
FROM `pmsg`
GROUP BY CONCAT( GREATEST( sender_id, recipient_id ) , LEAST( sender_id, recipient_id ) )
ORDER BY a DESC
LIMIT 3
注:sender_id:是指发件人id,recipient_id是指收件人id