我有以下查询:
"SELECT DISTINCT `emails`.`to`,`emails`.`from` as fromEmail
FROM `emails` WHERE ((`emails`.`from` = '".$loggedMember->id."')
OR (`emails`.`to` = '".$loggedMember->id."'))
AND (`emails`.`to` != 0) ORDER BY `id` DESC LIMIT 4"
并得到以下结果:
to fromEmail
887 1923
1923 887
1637 887
370 887
问题:我怎样才能避免前两个意义上的重复值,即使它们是相反的,它们仍然被认为是重复的“887 1923”和“1923 887”。