當我在下面的查詢中使用左邊的外部連接時,查詢無限地執行而不給出結果集。然而 - 單獨他們工作正常,如果我將其從左外連接更改爲內連接。但我需要下面的interregen表中的所有值。mysql-orderby和左外部連接問題
不理解什麼可能是錯誤:(
我的MySQL查詢:
SELECT r.name,
r.network,
r.namestring,
i.name,
i.description,
r.rid,
i.id,
d.dtime,
d.ifInOctets,
d.ifOutOctets,
FROM_UNIXTIME(d.dtime)
FROM range AS r
JOIN interregen AS i ON r.rid = i.rid
LEFT JOIN 1278993600_1_60 AS d ON i.id = d.id -- i.id is the primary key
AND dtime BETWEEN 1279026000 AND 1279040400
WHERE r.net = 'ITPN'
AND i.status = 'active'
ORDER BY i.id, d.dtime
請幫助! 感謝
您能否更新輸出:「DESC range」,「DESC interrgen」和「DESC 1278993600_1_60」?另外,每個表的'SELECT COUNT(*)FROM'的結果是什麼? – 2010-08-19 16:26:08