我有以下 2 个 SQL 语句
select
Fleet, SUM(hours) as Operating
from
table
where
colE = 'Operating'
and START_TIME >= '2012-01-01' and END_TIME<='2013-01-01'
and FLEET IS NOT NULL
group by
fleet
order by
FLEET asc
select Fleet, SUM(hours) as Delay
from table
where colE='Delay' and START_TIME>='2012-01-01' and END_TIME<='2013-01-01' and FLEET IS NOT NULL
group by fleet order by FLEET asc
我需要这两个陈述的结果来基本显示
select Fleet, (Operating / Delay ) as Calculated Col from table
任何人都可以帮助我引导我如何做到这一点?新的 sql 所以我相信我应该使用临时表?
谢谢!