--创建临时表
with 临时表名 as
(
--整合查询(两个查询结果合并)
--比如把父级和对应的子级查出
select * from a where a.id =3
union
select * from a where a.kid = 3
)
--查询统计零时表
select Sum(Famount) from 临时表名
Powered by: 博客园 Copyright © 2024 一佳一 Powered by .NET 9.0 on Kubernetes