Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.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 排序<=37天加上其他要求?_Sql_Oracle_Sorting_Grouping - Fatal编程技术网

Sql 排序<=37天加上其他要求?

Sql 排序<=37天加上其他要求?,sql,oracle,sorting,grouping,Sql,Oracle,Sorting,Grouping,我请求按以下方式对表进行排序,先看1,然后看2,然后看3: 示例_date只需在排序依据中使用多个键即可。你的规则是这样的: order by (case when sample_date <= 37 then 1 else 2 end), (case when field_x is not null then 1 else 2 end), (case when sample_date <= 37 then sampl

我请求按以下方式对表进行排序,先看1,然后看2,然后看3:


  • 示例_date只需在排序依据中使用多个键即可。你的规则是这样的:

    order by (case when sample_date <= 37 then 1
                   else 2 end),
             (case when field_x is not null then 1 else 2 end),
             (case when sample_date <= 37 then sample_date end) desc,
             number desc
    
    order by(样本日期时的情况)