第1个回答 2019-12-08
A、 按顺序号降序查出所有执行标志为允许执行的交易码。
select tran_no from t_bat_tran_ctrl where exec_flag = 1 order by serno desc;
B、 查出所有允许执行但未成功执行的交易码。
select tran_no from t_bat_tran_ctrl where exec_flag=1 and exec_stat<>1;
C、 查出所有不允许执行和已成功执行的交易码。
select trn_no from t_bat_tran_ctrl where exec_flag=0 or exec_stat=1;
D、 将交易码为“6201”的执行状态更改为“处理中”。
update t_bat_tran_ctrl set exec_stat=3 where tran_no='6201';
E、 查出所有处理中交易码的个数。
select count(tran_no) from t_bat_tran_ctrl where exec_stat=3;
F、 查出所有失败交易的名称。
select tran_name from t_bat_tran_desc where tran_no exist (
select distinct(tran_no) from t_bat_tran_ctrl where exec_stat='2'
);