------------------------------------------------有id,name,createDate的一张表testTable--根据name分组,获取每组中createDate最大的那条记录(整条)查询 ...
select from bdcdj.lqentry a where 顺序号 in select max 顺序号 from bdcdj.lqentry b WHERE b.archival code IS NOT NULL group by archival code 通过archival code分组,取顺序号的最大值。 ...
2019-10-21 10:56 0 614 推荐指数:
------------------------------------------------有id,name,createDate的一张表testTable--根据name分组,获取每组中createDate最大的那条记录(整条)查询 ...
方法一:(效率最高)select * from test as a where typeindex = (select max(b.typeindex) from test as b where ...
--有id,name,createDate的一张表testTable--根据name分组,获取每组中createDate最大的那条记录(整条)查询出来---------------------------------------------- 创建一张表,语句如下: CREATE TABLE ...
SQL 分组后获取其中一个字段最大值的整条记录 方法一:(效率最高)select * from test as a where typeindex = (select max(b.typeindex) from test as b where a.type = b.type ...
案列: 想更新A表的name字段,由于失误,在写这个表的时候,这个字段没有写,发现的时候,已经写了一个多月的数据了。改了之后的过程,会正常的写这个字段, 可是已经写了的数据也不能铲了,重新计算。 好在A表的name是可以从B表通过code关联查出来的。 于是,就有了下面这句 ...
1、 SELECT wmsys.wm_concat(t.org) orgs, t.area_nameFROM (SELECT concat(concat(b.abbreviation, '-'), ...
来自https://blog.csdn.net/gaoyao99409/article/details/19003729 select m.parent_id, m.st ...