我需要在同一个表上执行多个连接。以下是我的查询。 当我执行以下查询时,它为我提供了单个列的重复记录。 谁能告诉我哪里出错?
$result=mysql_query("SELECT DISTINCT *,CONCAT(phno, ' ', vnumber) AS source,CONCAT(phno, ' ', vnumber) AS destination FROM gcm_users as gu
INNER JOIN message_Log as ml1 ON gu.imei= ml1.Source_ID
INNER JOIN message_Log as ml2 ON gu.imei= ml2.Destination_ID
WHERE gu.id={$_SESSION['uid']}");
答案 0 :(得分:0)
您可以用一个
替换2个连接INNER JOIN message_Log as ml1 ON gu.imei= ml1.Source_ID
OR gu.imei= ml2.Destination_ID