我在对 interbase 中的数据进行排序时遇到问题,我的时间戳位于年、月、日等的单独列中,因此我需要按该顺序排序(尽管在这种情况下,即使按单个字段排序也行不通) . 由于某种原因,当与 CREATE VIEW 或 INSERT INTO 结合使用时,ORDER 命令会引发“令牌未知”错误。我在这里犯了一个愚蠢的语法错误,还是我尝试使用 ORDER 命令的方式存在更根本的问题?
CREATE VIEW HOURLY_AVES_SORT (MEASYEAR,MEASMONTH,MEASDAY,MEASHOUR,GH,GK,GDH,TA) as
SELECT
HOURLY_AVES_ALL.MEASYEAR, HOURLY_AVES_ALL.MEASMONTH, HOURLY_AVES_ALL.MEASDAY,
HOURLY_AVES_ALL.MEASHOUR, /*HOURLY_AVES.MEASMIN, HOURLY_AVES_ALL.MEASSECOND, */
HOURLY_AVES_ALL.GH, HOURLY_AVES_ALL.GK, HOURLY_AVES_ALL.GDH, HOURLY_AVES_ALL.TA
FROM HOURLY_AVES
ORDER BY
HOURLY_AVES_ALL.MEASYEAR, HOURLY_AVES_ALL.MEASMONTH, HOURLY_AVES_ALL.MEASDAY,
HOURLY_AVES_ALL.MEASHOUR
试图将数据复制到另一个表而不是视图中,会引发相同的未知错误,即:
INSERT INTO HOURLY_AVES_SORTED
(MEASYEAR,MEASMONTH,MEASDAY,MEASHOUR,GH,GK,GDH,TA)
SELECT
HOURLY_AVES_ALL.MEASYEAR, HOURLY_AVES_ALL.MEASMONTH, HOURLY_AVES_ALL.MEASDAY,
HOURLY_AVES_ALL.MEASHOUR, /*HOURLY_AVES.MEASMIN, HOURLY_AVES_ALL.MEASSECOND, */
HOURLY_AVES_ALL.GH, HOURLY_AVES_ALL.GK, HOURLY_AVES_ALL.GDH, HOURLY_AVES_ALL.TA
FROM HOURLY_AVES
ORDER BY
(MEASYEAR, MEASMONTH, MEASDAY,MEASHOUR, GH, GK,GH, TA)
非常欢迎任何提示,布赖恩