Sql (Oracle)跨列获取最大值
我的目标是为每一行获取最大值。 例如,我的表有两列,期望的输出是,每行80、70和90 我尝试了这段代码“从我的_表中选择MAX(column1,column2)”,它显示了错误,比如ORA-00909:argumants的数量无效 [我的_表和所需的输出]Sql (Oracle)跨列获取最大值,sql,oracle,Sql,Oracle,我的目标是为每一行获取最大值。 例如,我的表有两列,期望的输出是,每行80、70和90 我尝试了这段代码“从我的_表中选择MAX(column1,column2)”,它显示了错误,比如ORA-00909:argumants的数量无效 [我的_表和所需的输出] 使用最大值不最大值 with x as ( select 80 col1, 60 col2 from dual union all select 70, 50 from dual union all
使用
最大值
不最大值
with x as (
select 80 col1, 60 col2 from dual union all
select 70, 50 from dual union all
select 80, 90 from dual
)
select greatest( col1, col2 )
from x
将来,请将样本数据作为文本发布,我们可以复制和粘贴,而不是作为图像。