我有一个关于从表中获取最新记录的经典问题。这是声明:
SELECT t1.Item, t1.Price, t1.ODate
FROM Order AS t1
JOIN ( (SELECT Item, Price, Max(ODate) As MaxDate
FROM Order
GROUP BY Item ) As t2 )
ON t1.Item = t2.Item and t1.Odate = MaxDate
ORDER BY t1.Item ASC
此语句适用于 phpMyAdmin 和 LibreOffice base,但 LibreOffice basic 给我一条消息:SQL 表达式中的语法错误。
有什么帮助吗?