【发布时间】:2023-03-18 15:57:02
【问题描述】:
说明
- 选择最大反射率值作为最大值,最小反射率值作为最小值,其中 波长在 650 和 800 之间,并应用公式 (max+min)/2+min 作为辐射度
- 选择波长接近 700 的反射率为 r700 和
-
选择波长接近740的反射率为r740
应用公式
700+(辐射-r700)/(r740-r700)*40
输出值作为 radtera,我想显示辐射值和 radtera 值作为输出
我试过这个查询,它在辐射度中显示了很多值,并且在 radtera 中显示了许多空值,但我只想显示一个辐射度值和一个 radtera 值
SELECT radiance, (700+(radiance-r700))/((r740-r700)*40) as radtera
FROM (
SELECT (MAX(reflectance)+MIN(reflectance))/2+MIN(reflectance) as radiance,
case when wavelength=700 then reflectance end as r700,
case when wavelength=740 then reflectance end as r740
FROM table_name
WHERE wavelength between 650 and 800
GROUP BY wavelength,reflectance
) AS SE_23693370
如果我删除
按波长、反射率分组
这个来自查询,它显示错误
这里是SQL fiddle。
我检查了它,我不知道它是如何显示多个值而不是一个值显示的.. 请任何人帮助我纠正错误...
我尝试在 SQL fiddle 中使用 case 语句。
select reip,700+(reip-r45)/(r72-r45)*40 as reipw
from (
select (mx+mn))/2+mn as reip
from (
select case max(tert) as mx,
case min(tert) as mn
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)bar
)as SE_23693370
它显示 *ERROR: subquery in FROM must have an alias: select reip,700+(reip-r45)/(r72-r45)40 as reipw from (select (mx+mn))/2+ mn as reip from ( select case max(tert) as mx, case min(tert) as mn 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 介于 43 和 79 之间) ) 为 SE_23693370
【问题讨论】:
-
你想让 StackOverflow 帮你做作业吗?
标签: mysql sql postgresql