【java】:多表关联、排序
2024-08-22 03:04:33
SELECT * FROM (
SELECT coll.collection_id, coll.report_id, coll.new_id, news.title,news.abstract_txt,news.url,coll.coll_time FROM tb_collection_report AS coll, tb_news AS news
WHERE coll.collection_id = #{collectionID,jdbcType=VARCHAR} AND coll.new_id = news.nid
UNION ALL
SELECT coll.collection_id, coll.report_id, coll.new_id, report.title,report.abstract_txt,report.url,coll.coll_time FROM tb_collection_report AS coll, tb_report AS report
WHERE coll.collection_id = #{collectionID,jdbcType=VARCHAR} AND coll.report_id = report.id
) AS temp
ORDER BY temp.coll_time DESC
LIMIT #{limitStart,jdbcType=INTEGER}, #{limitEnd,jdbcType=INTEGER}
最新文章
- Oracle SGA优化
- Assign an Elastic IP Address to Your Instance
- [转]搬瓦工换机房换ip之后不能连外网
- sed 引入shell变量
- java反射基本使用操作
- vb.net三层实现登录例子
- 关于前置式递增和后置式递增的小知识(++x与x++)
- mina2.0 spring
- 使用Maven构建javaWeb项目时,启动tomcat出错:严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.conte
- 转:Python 与 Excel 不得不说的事
- 新版ADT出现appcompat_v7的问题
- c# in depth之泛型的实现
- 工控中的windows
- hdu_5963:朋友
- selenium 对chrome浏览器操作
- Swift tableview自带的刷新控件
- LeetCode 811 Subdomain Visit Count 解题报告
- spring注解注入的学习
- ABP配置模块扩展
- vs的【warning C4996:'fopen': This function or variable may be unsafe】解决方案