有些业务逻辑并非只能通过Java代码实现,巧用临时表也可以的。
demo:
<select id="getTest" resultType="java.lang.String">
select * into #TEMPTable from Table where a = #{a}
select c from #TEMPTable where b = #{b}
drop table #TEMPTable
</select>
StephenJava ©著作权
有些业务逻辑并非只能通过Java代码实现,巧用临时表也可以的。
demo:
<select id="getTest" resultType="java.lang.String">
select * into #TEMPTable from Table where a = #{a}
select c from #TEMPTable where b = #{b}
drop table #TEMPTable
</select>
下一篇:SQL排序后编序号
创建临时表 方法一: create table #临时表名(字段1 约束条件, &
在Oracle8i或以上版本中,可以创建以下两种临时表: 1。会话特有的临时表 CREATE GLOBAL TEMPORARY <TABLE_NAME> (<column
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M