表17:VOD 压强详细数据(QQ_VOD_Pressure_Data_B1)
字段名 | 数据源字段名 | 字段类型 | P(F) Key | NULL | Use | 说明 | 单位 |
Lh | Heat_id | Varchar(11) | P | N | Ö | 炉号 |
|
ID | 数据序号(对于同一炉次) | Int | P | N | Ö | 数据ID |
|
Get_Time | Event_time | datetime |
| N | Ö | 取数据时刻 |
|
pressure | pressure | Real |
|
| Ö | 压强 | Pa |
|
|
|
|
|
|
|
|
(数据表来源:VD_Pressure_Steps, 其中ID字段代表该数据对于同一炉次的采样数据序号,在数据抽取时通过计算得到)
源表中有一个id列作为表的主键,Event_time是采样时间,随主键的增长,时间值也越来越大,一炉采多次压强值。
目标表中需要有一列对应着某一炉对应的采样序号。可以使用下面的sql语句实现:
select ora.id,ora.heat_id,ora.pressure,ora.event_time,(ora.id-tempid.min_id+1)as xhh
from F_id_generate as ora,
(select max(id) as max_id,min(id) as min_id,heat_id from F_id_generate group by heat_id) as tempid
where ora.heat_id=tempid.heat_id
order by event_time