Oracle数据库中分组取最小时间的那条记录的所有字段信息(方法)
程序员文章站
2022-03-30 12:25:14
MERGE INTO user_member_info a
USING ( select min(UP.created) as cre,min(up.shop_no) as sh...
MERGE INTO user_member_info a
USING ( select min(UP.created) as cre,min(up.shop_no) as shop_no,up.memberid as memberid
from user_platform_relation up,
( select memberid as mid,min(created) as cre
from user_platform_relation
group by memberid) um
where up.created = um.cre and up.memberid = um.mid
group by up.memberid) b
ON (a.id = b.memberid
)
WHEN MATCHED THEN UPDATE SET a.created = b.cre,a.shop_no = b.shop_no,a.modified_time = sysdate
where a.shop_no is null;
上一篇: 让远程传输大文件变得更快
下一篇: MacOS 滚动非活动窗口中的内容