sql,联合主键,按id分组求版本号最大值的集合
表结构如下:
/*
SQLyog v10.2
MySQL - 5.5.39
*********************************************************************
*/
/*!40101 SET NAMES utf8 */; create table `seal` (
`id` varchar (96),
`update_user` varchar (96),
`update_time` datetime ,
`seal_name` varchar (150),
`remark` varchar (600),
`is_enable` int (1),
`seal_image` blob ,
`seal_version` int (11),
`is_del` int (1)
);
insert into `seal` (`id`, `update_user`, `update_time`, `seal_name`, `remark`, `is_enable`, `seal_image`, `seal_version`, `is_del`) values('91b2b13c47aa4cf7b5faf9093c899cfc','820e2deb8efe11e4b4a2bcaec5330601','2015-11-26 15:53:59','','','','??,'1','1');
insert into `seal` (`id`, `update_user`, `update_time`, `seal_name`, `remark`, `is_enable`, `seal_image`, `seal_version`, `is_del`) values('91b2b13c47aa4cf7b5faf9093c899cfc','820e2deb8efe11e4b4a2bcaec5330601','2015-11-26 15:54:49','1','1111','1','塒NG\r\n\Z\n','2','1');
对应的mysql如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABNMAAACDCAMAAACQjq2eAAAAAXNSR0IArs4c6QAAAexQTFRF09nj8fHxtbW1oaGhyce5Rlp8/uGZ////9fX14+XvAAAA3d3rRlpf193jRlpngZi5Rlpj89SSTGaNZGNk8eC0R1pcr/X1YziOoeXv//+3/+inAAAz/umu9st688+J7+zR882BiTZi7+XF7+nLi9X4kce5/uy629rVxIAzRlpq/vDI04k29fWvd3l6/v388dmj4+WrRlps/eOfXgAA8dup8dedgTJdrmEAt///7+O9AABg0M3CgsPvNonTYq/0MoDM4sSHADeL9dSJiTUAO5HbkZGQMwAAyapmWqLv1tXNrrS2zNDQPTJ6/7dm46JeLnGb9bBhbq21YQBhPGe0yceDADKH//TW//rryY5IOlylgTIAkTlmr2I30AgLOjw9Gy1l5sNmy8i8HFCAPgVEcCxIiz8y58Njqq2yKCkiAABI35M7rW4qAFyq4uXrlFIAVIu2I4QK5OrvZrf/I1UIAGKvUAAFT60IkToAK4lO7/n8q/D09qqsA2W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cxvYuxzZe6xATaRlGrxxkx7L5fnObUlsc9FaWyjDAmh3E+/cZtVZUV5ftuud2+w9VqAm/OeErDzRd6OK2rCi/25UkV1fKvi7UcQ0YhoxrQz3RQXPy0FzDRHTiGmVdOQUw0YUlGk0zy2JRCqneW4jJBKJVD4ippFIJGIaiUQiEdNIJBKJmEYikUjENBKJREwjkUgkYhqJRCIR00gkEomYRiKRSMQ0EolETCORSCRiGolEIhHTSCQSiZhGIpFIxDQSiURMI5FIJGIaiUQiEdNIJBIpH/0/e+t/RNkAUfcAAAAASUVORK5CYII=" alt="" />
现在的需求是:因为表中用的是联合主键,id+seal_version,所以id可能相同,
要求:求出id一样的数据中,seal_version最大的数据
select * from seal sl
left join
(
select id,max(seal_version) as seal_version from seal
group by id
) temp
on sl.id=temp.id and sl.seal_version=temp.version
sql,联合主键,按id分组求版本号最大值的集合的更多相关文章
- SQL联合主键 查重
2014年最后一天,今天在给数据库导入数据的时候,遇到一个问题,就是联合主键去重. 事情是这样的,现有一个表M,我想找个表中导入了许多数据,并需要将字段A(int)和B(int)联合设置为主键. 但是 ...
- sql联合主键,用于多对多,关系映射
如题.记录下. 复合主键,由多个字段共同确定一行信息 composite key, containing multi cols to fix one element.
- SQL Server中的联合主键、聚集索引、非聚集索引、mysql 联合索引
我们都知道在一个表中当需要2列以上才能确定记录的唯一性的时候,就需要用到联合主键,当建立联合主键以后,在查询数据的时候性能就会有很大的提升,不过并不是对联合主键的任何列单独查询的时候性能都会提升,但我 ...
- SQL Server中的联合主键、聚集索引、非聚集索引
我们都知道在一个表中当需要2列以上才能确定记录的唯一性的时候,就需要用到联合主键,当建立联合主键以后,在查询数据的时候性能就会有很大的提升,不过并不是对联合主键的任何列单独查询的时候性能都会提升,但我 ...
- 联合主键SQL 联合索引
联合主键索引 联合索引 ALTER TABLE [dbo].[Tb_Shop] ADD CONSTRAINT [shopno] UNIQUE NONCLUSTERED ( [ShopGid] ASC, ...
- Hibernate(5)—— 联合主键 、一对一关联关系映射(xml和注解) 和 领域驱动设计
俗话说,自己写的代码,6个月后也是别人的代码……复习!复习!复习!涉及的知识点总结如下: One to One 映射关系 一对一单向外键(XML/Annotation) 一对一双向外键关联(XML/A ...
- 聚集索引、非聚集索引、聚集索引组织表、堆组织表、Mysql/PostgreSQL对比、联合主键/自增长、InnoDB/MyISAM(引擎方面另开一篇)
参考了多篇文章,分别记录,如下. 下面是第一篇的总结 http://www.jb51.net/article/76007.htm: 在MySQL中,InnoDB引擎表是(聚集)索引组织表(cluste ...
- 在LINQ中实现多条件联合主键LEFT JOIN
我昨天遇到一个LINQ下使用多条件比对产生LEFT JOIN的问题,经过深入研究,终于解决了,也让我学到了新的东西,特地拿来分享. 实例:有一张库存异常变更视图KCYD,仓库ID[Ckid]和物品ID ...
- hibernate 注解 联合主键映射
联合主键用Hibernate注解映射方式主要有三种: 第一.将联合主键的字段单独放在一个类中,该类需要实现java.io.Serializable接口并重写equals和hascode,再将 该类注解 ...
随机推荐
- Erlang之父的学习历史及学习建议
当我开始学习编程的时候(1967年),我可以在 FORTRAN 和(传说中的)Algol 之间选择,不过没有任何人了解 Algol,所以我选择了 FORTRAN. 在我最早学习编程的时候,我的编程周期 ...
- mac下使用minicom
各种艰辛就不一一表过了,反正最后无奈的有捡起了minicom. 因为使用的brew,所以安装相对比较容易: brew install minicom 和Linux下一样的操作,先是查看硬件设备名称: ...
- map 几种遍历方法
public static void main(String[] args) { Map<String, String> map = new HashMap<String, Stri ...
- 提示用户一直输入数字(默认为正整数),当用户输入end的时候显示当前输入数字中的最大值。
string input = ""; ; while (input != "end") { Console.WriteLine("请输入一个正整数,输 ...
- Hibernate之多对多
一.项目结构如下图 二.保存学生和课程及其学生选课关系代码如下(测试类中不能再有双向关联,否则会报错,因为,都维护了中间表外键,会有中间表外键冲突,如果非要写双向关联,就需要配置中设置某一方维护主键, ...
- SCI完全攻略:从构思到发表
- Python socket编程之七:多窗口的应用
f1.py # -*- coding: utf-8 -*- import socket import struct import sqlalchemy import pandas ########## ...
- DedeCms 5.x 本地文件包含漏洞(respond方法)
漏洞版本: DedeCms 5.x 漏洞描述: DedeCms是免费的PHP网站内容管理系统. plus/carbuyaction.php里没有对变量进行严格的过滤 出现漏洞的两个文件为: Inclu ...
- struts2拦截器interceptor的三种配置方法
1.struts2拦截器interceptor的三种配置方法 方法1. 普通配置法 <struts> <package name="struts2" extend ...
- MSN
msn (微软软件) 编辑 MSN,全称Microsoft Service Network,是微软公司(Microsoft)旗下的门户网站. MSN(门户网站)提供包括必应搜索.文娱.健康.理财.汽车 ...