此处为 Maximo 的最终用户。尝试编写一个查询来对名为 Time% 和 Meter% 的两列进行排序,按任一列中最大的列按降序排列,不少于 95%。
这是我的询问:
((exists (select 1 from maximo.asset where ((location like '%RDU%')) and (assetnum = pm.assetnum and siteid=pm.siteid) and (plustisconsist=0)))) and ((fxf_meterpercent > 95.0 or fxf_timepercent > 95.0)) order by GREATEST( COALESCE(fxf_timepercent, 0), COALESCE(fxf_meterpercent, 0) )
这是结果,您可以看到它按 ASC 排序,但我希望它按降序排列。
您可以在 SQL 查询末尾添加 desc 以进行降序排列。 样品在这里
((exists (select 1 from maximo.asset where ((location like '%RDU%')) and (assetnum = pm.assetnum and siteid=pm.siteid) and (plustisconsist=0)))) and ((fxf_meterpercent > 95.0 or fxf_timepercent > 95.0)) order by GREATEST( COALESCE(fxf_timepercent, 0), COALESCE(fxf_meterpercent, 0) ) desc