ibatis 嵌套insert select语句

来源:互联网 发布:安大略艺术学院 知乎 编辑:程序博客网 时间:2024/05/20 01:35

从dsp_subject 表查询若干记录,与其他记录‘somedesc’ 合并作为一条记录,插入到表dsp_hstry中


insert into dsp_hstry (sub_no,editer_no,edit_date,clasy,version,edit_des)(select no,cre_no,cre_date,clasy,version,'somedesc'from dsp_subject where no = 1);

注:语法是 

insert into table1(a,b,c)(select a,b,"something" from table2)



原创粉丝点击