orocle数据库查询 将重量这一列的最大值乘以1.2,最小值乘以0.8,然后再查出下面一样的表格
不是单独查最大值和最小值select*from(SELECTORDER_NO,max(casewhenQTINDEXCODE='1'thenQTINDEXVALUEend...
不是单独查最大值和最小值
select * from (SELECT ORDER_NO ,
max(case when QTINDEXCODE='1' then QTINDEXVALUE end) as 重量
,max(case when QTINDEXCODE='2' then QTINDEXVALUE end) as 圆周
,max(case when QTINDEXCODE='3' then QTINDEXVALUE end) as 圆度
,max(case when QTINDEXCODE='4' then QTINDEXVALUE end) as 吸阻
,max(case when QTINDEXCODE='6' then QTINDEXVALUE end) as 硬度
,max(case when QTINDEXCODE='5' then QTINDEXVALUE end) as 长度
FROM MV_DC_QL_QTSAMPLEDETAIL where 1=1 and DC_QL_QUALITYTESTSAMPLEID='B4D7CBFB4E1B43CA80DDD43F6C1E762A' GROUP BY ORDER_NO) ORDER BY ORDER_NO; 展开
select * from (SELECT ORDER_NO ,
max(case when QTINDEXCODE='1' then QTINDEXVALUE end) as 重量
,max(case when QTINDEXCODE='2' then QTINDEXVALUE end) as 圆周
,max(case when QTINDEXCODE='3' then QTINDEXVALUE end) as 圆度
,max(case when QTINDEXCODE='4' then QTINDEXVALUE end) as 吸阻
,max(case when QTINDEXCODE='6' then QTINDEXVALUE end) as 硬度
,max(case when QTINDEXCODE='5' then QTINDEXVALUE end) as 长度
FROM MV_DC_QL_QTSAMPLEDETAIL where 1=1 and DC_QL_QUALITYTESTSAMPLEID='B4D7CBFB4E1B43CA80DDD43F6C1E762A' GROUP BY ORDER_NO) ORDER BY ORDER_NO; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询