问题描述
- Oracle数据查询帮忙看看
-
将重量这一列最大值乘以1.2,最小值乘以0.8然后查询同样的表,不是单独查
select * from (SELECT ORDER_NO,
max(case when t.QTINDEXCODE='1' then t.QTINDEXVALUE end) as 重量
,max(case when t.QTINDEXCODE='2' then t.QTINDEXVALUE end) as 圆周
,max(case when t.QTINDEXCODE='3' then t.QTINDEXVALUE end) as 圆度
,max(case when t.QTINDEXCODE='4' then t.QTINDEXVALUE end) as 吸阻
,max(case when t.QTINDEXCODE='6' then t.QTINDEXVALUE end) as 硬度
,max(case when t.QTINDEXCODE='5' then t.QTINDEXVALUE end) as 长度
FROM MV_DC_QL_QTSAMPLEDETAIL T
where 1=1 and t.DC_QL_QUALITYTESTSAMPLEID='B4D7CBFB4E1B43CA80DDD43F6C1E762A' GROUP BY ORDER_NO) ORDER BY ORDER_NO;
解决方案
select * from 表 where 列=(select max(列) from 表 )*1.2 and 列=(select min(列) from 表 )*0.8
时间: 2024-11-05 22:38:41