有些业务逻辑并非只能通过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>
有些业务逻辑并非只能通过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排序后编序号
临时表是复杂SQL性能优化中常见手段,总结一下。 1) Global Temporary 句 分为会话级和事务级两种。 会话级的临时表 【语法】  
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M