SQL学习笔记

来源:互联网 发布:js button 显示隐藏 编辑:程序博客网 时间:2024/06/05 05:55
select * from (
   select * from table t where t.no='条件' order by t.iddesc ) C where rownum=1;

insert into ri_i_inform select SEQ_RI_I_INFORM.nextval,t.ced_quote_no,t.ced_quote_endo_no,t.branch_code,t.creator_code,sysdate, t.origin_type,'0',sysdate,'0',t.ced_policyno,t.ced_endo_no,t.policystatus,sysdate from (select * from( select * from ri_i_inform r where r.ced_quote_no='ABEJ05002413P000092P' and r.ced_policyno=? and r.ced_quote_endo_no=? and r.origin_type=? order by r.informid desc) C where rownum=1) t;

存在多条数据,去序列号最大的一条


原创粉丝点击