当前位置: 首页 > news >正文

presto 分页

表dw.student

idbigint主键
namestring姓名
agebigint年龄

presto 分页 sql

<sql id="Where_Clause"><if test="ages != null and ages.size>0">and d.age in<foreach close=")" collection="ages" item="item" open="(" separator=",">${item}</foreach></if><if test="names != null and names.size>0">and d.name in<foreach close=")" collection="names" item="item" open="(" separator=",">${item}</foreach></if>
</sql>
<select id="queryStudentList" resultType="com.orm.presto.model.Student" statementType="STATEMENT">SELECT * FROM (selectid, name,age,case when age in (0,1) then 1 WHEN age = 2 then 2 else 3 end ageDuration,ROW_NUMBER() over (<if test="orderFlag == null">order by '${sortColumn}' ${sort}</if>) as rowfrom dw.student dwhere<include refid="Where_Clause"/>) awhere a.row between (${currentPage}-1)*${pageSize}+1 and ${currentPage}*${pageSize}
</select>


http://www.mrgr.cn/news/4188.html

相关文章:

  • Element-ui table进阶使用
  • 设计模式六大原则(四)--接口隔离原则
  • 如何使用AWS EC2资源?
  • 【经典算法】BFS_最短路问题
  • 将 hugo 博客搬迁到服务器
  • javaEE中自定义注解以及注解的解析
  • 【HTML】从0开始构建HTML页面
  • 探索Ruby在物联网世界的无限可能:智能连接与创新应用
  • 高校迎新系统app/基于android的高校迎新系统的设计与实现
  • Tomcat使用及负载均衡(最全源码安装及配置使用教程)
  • 如何提升网络对AI大模型流量的承载能力?
  • kotlin adapter赋值失效
  • 使用dockerDesktop下载x86,amd64,arm64镜像
  • 【STM32 FreeRTOS】任务
  • 生活垃圾填埋场污染监测:新标准下的技术革新与环境保护
  • MBR20100FCT-ASEMI无人机专用MBR20100FCT
  • 绝对能让你效率起飞的10个AI工具及ChatGPT国内镜像集合【2024必备】
  • IPC对象通信方式---共享内存 | 网络通信 -编程
  • C++ //练习 17.33 修改11.3.6节(第392页)中的单词转换程序,允许对一个给定单词有多种转换方式,每次随机选择一种进行实际转换。
  • Go小技巧易错点100例(十七)