1
SELECT table1.*,table2.*, table3.*
FROM table1, table2, table3
inner join
(
select table1.id AS pid, max(table1.createtime) AS timestamp
from table1 group by table1.id
) A on A.pid = table1.id AND A.timestamp = table1.createtime
WHERE table3.id = table1.id
ORDER BY table1.createtime;
我想只抓取table1中每個id的最後修改記錄。在內部聯接查詢中需要幫助
對於我得到的錯誤作爲上述查詢:
"%s:invalid identifier" for "A.timestamp = table1.IDA2A2" this part.
請讓我知道什麼是錯的這個查詢。 DB是Oracle。