我的请求包含一个括号错误,但是没有

omhiaaxx  于 2021-07-24  发布在  Java
关注(0)|答案(2)|浏览(628)

我在写这个公式时有一个错误(1-接近“(”:语法错误),但我没有看到“(”)缺失,提前谢谢你的帮助。

select_last_tourn AS (
                SELECT fc.ID as FC_ID,fc.IDENTIFIANT, t.ID as TOUR_ID, t.DATE_TOURNEE,
                               max (t.DATE_TOURNEE) OVER (ORDER BY t.DATE_TOURNEE) DT_LAST_TOURNEE
                FROM RSF_FICHE_11 fc
                lEFT JOIN mnt ON fc.ID=mnt.ID1
yqlxgs2m

yqlxgs2m1#

如果您正在使用cte,请尝试以下操作:

WITH select_last_tourn AS (
                SELECT fc.ID as FC_ID,fc.IDENTIFIANT, mnt.ID as TOUR_ID, mnt.DATE_TOURNEE,
                max (mnt.DATE_TOURNEE) OVER (ORDER BY mnt.DATE_TOURNEE) DT_LAST_TOURNEE
                FROM RSF_FICHE_11 fc
                lEFT JOIN mnt ON fc.ID=mnt.ID1
                           )

SELECT * FROM select_last_tourn
nkhmeac6

nkhmeac62#

听了你的话,我做了新的测试。没有成功,我把剩下的请求。

WITH mnt AS (
select cast(mt.ID as numeric) as ID, cast(mt.ID1 as numeric) as ID1,
format_date(t.DATE_TOURNEE,'dd/MM/yyyy') as DATE_TOURNEE  
FROM MR_P mt 
LEFT JOIN RF_TOURNEE t ON mt.ID=t.ID
)
SELECT fc.ID as FC_ID,fc.IDENTIFIANT, mnt.ID as TOUR_ID, mnt.DATE_TOURNEE,max (mnt.DATE_TOURNEE) OVER (ORDER BY mnt.DATE_TOURNEE) DT_LAST_TOURNEE
FROM RF_Fiches fc 
LEFT JOIN mnt ON fc.ID=mnt.ID1;

错误sql

相关问题