select row_number()OVER(ORDER BY 年份 DESC) as ID, *from 税金合计视图
with cte as (
select 日期 as "日期","" as "外经证金额","" as "开票金额","" as "应收账款","" as "自筹资金","" as "代付费用费率","" as "代付费用金额","" as "规费费率","" as "规费金额","" as "工程考核金费率","" as "工程考核金金额","" as "预留税金费率","" as "预留税金金额","" as "应交增值税",销项税 as "销项税",抵扣分包 as "抵扣分包",进项税 as "进项税",抵扣调整 as "抵扣调整",进项税转出 as "进项税转出",预缴税金 as "预缴税金",调出进项税 as "调出进项税",调入进项税 as "调入进项税","" as "借款","" as "利息","" as "其他","" as "实际支付款","公司一般户" as "出入账账户","否" as "作废是否","" as "备注","" as "补充说明",工程名称ID as "工程名称ID",承包人 as "承包人","" as FGC_State,"" as FGC_CreateDate,"" as FGC_LastModifyDate,"税金" as tablename,id||"税金" as key,id as "原表ID" from 项目税金合计视图
select
(select count(*) from cte b where a.key >= b.key) as ID,
日期,
外经证金额,
开票金额,
应收账款,
自筹资金,
代付费用费率,
代付费用金额,
规费费率,
规费金额,
工程考核金费率,
工程考核金金额,
预留税金费率,
预留税金金额,
应交增值税,
销项税,
预缴税金,
抵扣分包,
进项税,
抵扣调整,
调出进项税,
调入进项税,
进项税转出,
借款,
利息,
其他,
实际支付款,
出入账账户,
作废是否,
备注,
补充说明,
工程名称ID,
承包人,
tablename as 功能名称,
FGC_State,
FGC_CreateDate,
FGC_LastModifyDate,
原表ID
from cte as a
order by key
这两个视图有什么问题? 删除就好了 |