本帖最后由 yulonger 于 2020-9-18 13:31 编辑
原本要写成这样的,一直提示错误。
with cte as (
Select FGC_AssignTo,FGC_State,"工作计划详情" as 页面,id||"工作计划详情" as key,id,主题,单据编号 from G工作计划
union all
Select FGC_AssignTo,FGC_State,"工作计划详情" as 页面,id||"工作计划详情" as key,id,主题,单据编号 from G工作计划
)
select
(select count(*) from cte b where a.key >= b.key) as ID,
页面,
FGC_AssignTo,
FGC_State,
ID,
主题
from cte as a
order by key
请问哪里的问题呀?我之前一直这样写倒是没问题,谢谢了
Select FGC_AssignTo,FGC_State,"工作计划详情" as 页面,id||"工作计划详情" as key,id,主题,单据编号 from G工作计划
union all
Select FGC_AssignTo,FGC_State,"工作计划详情" as 页面,id||"工作计划详情" as key,id,主题,单据编号 from G工作计划
|