Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字段,我想获得最大值,但它是一个 varchar2(6) 字段,所有数字。我无法更改字段类型
该字段是 2013 年 7 月像这样 201307 列出的日期。仅使用 MAX 不起作用。
使用甲骨文。
SELECT MAX(date) "MostRecent" FROM tablename;
应该管用。YYYYMM 将在 Oracle 的 MAX 聚合或分析函数中按最新排序。