描述
式
700+(reip-r45)/(r72-r45)*40
输出值为repw 我想显示reip值和repw值作为输出
我在PostGreSQL中尝试过它
Select (MAX(tert)+MIN(tert))/2+MIN(tert) as reip from table_name where iner between 43 and 79
这是有效的,但我不知道在这个公式中应用700+(reip-r45)/(r72-r40)* 40中的这个reip值以及如何将输出值显示为reip和repw
我试过这个查询它不起作用..
select reip, 700+(reip-r45)/(r72-r45)*40 as reipw
from (
select (MAX(tert)+MIN(tert))/2+MIN(tert) as reip, tert where iner=44.5 as r45, tert where iner=71.9 as r72
from table_name
where iner between 650 and 800
) as SE_23693370
如何将任务作为单个查询执行?有人引导我......
答案 0 :(得分:1)
更改您的查询,如下所示
select reip,
(700+(reip-r45))/((r72-r45)*40) as reipw
from (
select (MAX(tert)+MIN(tert))/2+MIN(tert) as reip,
case when iner=44.5 then tert end as r45,
case when iner=72.1 then tert end as r72
from table_name
where iner between 43 and 79
group by iner,tert
) as SE_23693370