使用下面的语句查询出来的表是正常的:
select p.c0007_point_id,
p.c0007_point_desc,
p.c0004_datacat_id,
p.c0003_station_no,
p.C1220_meastypeid,
d.c0059_normal_desc_value,
d.c0010_alarm_calc_flag
from t0010_di d,
t0007_point p
where d.c0007_point_id = p.c0007_point_id
and p.c0007_point_desc like '%软压板%'
and p.C1220_meastypeid = 701
and d.c0007_point_id=209098;
其中c0007_point_id是主键
现在我想更改p.C1220_meastypeid和 d.c0059_normal_desc_value这两个列的值,下面两种方法更新表都会报错
update (select p.c0007_point_id,
p.c0007_point_desc,
p.c0004_datacat_id,
p.c0003_station_no,
p.C1220_meastypeid,
d.c0059_normal_desc_value,
d.c0010_alarm_calc_flag
from t0010_di d,
t0007_point p
where d.c0007_point_id = p.c0007_point_id
and p.c0007_point_desc like '%软压板%'
and p.C1220_meastypeid = 701
)
set t0010_di.c0059_normal_desc_value=95
where t0010_di.c0007_point_id=209121;
update t0010_di
set t0010_di.c0059_normal_desc_value=95
where t0010_di.c0007_point_id=209121
and t0010_di.c0007_point_id = t0007_point.c0007_point_id
and t0007_point.c0007_point_desc like '%软压板%'
and t0007_point.C1220_meastypeid = 701;
select p.c0007_point_id,
p.c0007_point_desc,
p.c0004_datacat_id,
p.c0003_station_no,
p.C1220_meastypeid,
d.c0059_normal_desc_value,
d.c0010_alarm_calc_flag
from t0010_di d,
t0007_point p
where d.c0007_point_id = p.c0007_point_id
and p.c0007_point_desc like '%软压板%'
and p.C1220_meastypeid = 701
and d.c0007_point_id=209098;
其中c0007_point_id是主键
现在我想更改p.C1220_meastypeid和 d.c0059_normal_desc_value这两个列的值,下面两种方法更新表都会报错
update (select p.c0007_point_id,
p.c0007_point_desc,
p.c0004_datacat_id,
p.c0003_station_no,
p.C1220_meastypeid,
d.c0059_normal_desc_value,
d.c0010_alarm_calc_flag
from t0010_di d,
t0007_point p
where d.c0007_point_id = p.c0007_point_id
and p.c0007_point_desc like '%软压板%'
and p.C1220_meastypeid = 701
)
set t0010_di.c0059_normal_desc_value=95
where t0010_di.c0007_point_id=209121;
update t0010_di
set t0010_di.c0059_normal_desc_value=95
where t0010_di.c0007_point_id=209121
and t0010_di.c0007_point_id = t0007_point.c0007_point_id
and t0007_point.c0007_point_desc like '%软压板%'
and t0007_point.C1220_meastypeid = 701;