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.
请让我知道这个查询有什么问题。数据库是甲骨文。