Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql (Oracle)跨列获取最大值_Sql_Oracle - Fatal编程技术网

Sql (Oracle)跨列获取最大值

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

我的目标是为每一行获取最大值。 例如,我的表有两列,期望的输出是,每行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
      select 80, 90 from dual
    )
    select greatest( col1, col2 )
      from x

将来,请将样本数据作为文本发布,我们可以复制和粘贴,而不是作为图像。