百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 编程网 > 正文

获取每个id最新日期的工作步骤

yuyutoo 2025-02-15 18:05 3 浏览 0 评论


select *,max(date) from basic_group_fetch_max_date_row group by id;


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

<%

Response.ContentType = "text/html"

Response.AddHeader "Content-Type", "text/html;charset=UTF-8"

Response.CodePage = 65001

Response.CharSet = "UTF-8"

%>

<%

function echo(s)

if asp=1 then

Response.Write(s)

else

debug.print s

end if

end function

function debugStart()

if asp=1 then

echo("start<br>")

ON ERROR RESUME NEXT

end if

end function

function initial_input_arr(blFromSheet)

if asp=1 or (blFromSheet=0) then

redim arr(3,3)

arr(1,1)="1"

arr(1,2)="2022-11-01"

arr(1,3)="step1"

arr(2,1)="1"

arr(2,2)="2022-11-02"

arr(2,3)="step2"

arr(3,1)="2"

arr(3,2)="2022-11-02"

arr(3,3)="step2"

else

ws="Sheet1"

arr=worksheets(ws).range("A2").currentregion

end if

initial_input_arr=1

end function

function show_arr(arr_input)

if asp=1 then

echo("<table border=1>")

For i=1 to Ubound(arr_input)

echo("<tr>")

For j=1 to Ubound(arr_input,2)

echo("<td>")

echo(arr_input(i,j))

call show_erro()

echo("</td>")

Next

Response.Write("</tr>")

next

Response.Write("</table>")

show_arr=1

end if

end function

sub show_erro()

if asp=1 then

If err.Number <> 0 Then

'...you could display the error info directly in the page...

echo("Error Description: " & err.Description)

echo("Error Source: " & err.Source)

echo("Error Number: " & err.Number)

Response.End

End If

end if

End Sub

function myCreateObject(obj)

if asp=1 then

set myCreateObject=server.CreateObject(obj)

else

set myCreateObject=CreateObject(obj)

end if

end function

function show_each_key_of_d(dic)

if asp<>1 then

show_each_key_of_d=0

exit function

end if

Response.Write("<table border=1>")

for each k in dic.keys

if typeName(dic(k))="classRow" then

Response.Write("<tr><td>" & k & "</td><td>" & "dic(k)" & "</td></tr>" )

else

Response.Write("<tr><td>" & k & "</td><td>" & dic(k) & "</td></tr>" )

end if

next

Response.Write("</table>")

show_each_key_of_d=1

end function

class classRow

Public RowId

Public key

Public function ToString()

ToString=RowId & "~" & key & "<br>"

end function

end class

function getRow(rowId,key)

set getRow=new classRow

getRow.RowId=rowId

getRow.key=key

end function

function getArrResult(d)

dim brr()

redim brr(d.count,Ubound(arr,2))

n=0

for each k in d.keys

n=n+1

rem echo("k value:" & k)

set objR=d(k)

for c=1 to Ubound(arr,2)

brr(n,c)=arr(objR.RowId,c)

next

next

getArrResult=brr

end function

function arToRange(ar)

if asp=1 then

else

workbooks("Sheet2").[A2].resize(Ubound(ar),Ubound(ar,2))=ar

end if

end function

sub main()

dim d

set d=myCreateObject("Scripting.dictionary")

For i=1 to Ubound(arr)

if not d.exists(arr(i,1)) then

rem obtain date

set objR=getRow(i,arr(i,2))

set d(arr(i,1))=objR

else

set objR=d(arr(i,1))

if objR.key<arr(i,2) then

objR.key=arr(i,2)

objR.RowId=i

set d(arr(i,1))=objR

end if

show_erro()

end if

next

arResult=getArrResult(d)

echo("original data")

rem show_arr(arr)

echo("Result")

show_arr(arResult)

echo("finish")

arToRange(arResult)

end sub

dim asp

asp=1

dim arr

initial_input_arr(0)

main()

%>

相关推荐

微软Win10/Win11版Copilot上线:支持OpenAI o3推理模型

IT之家4月3日消息,科技媒体WindowsLatest昨日(4月2日)发布博文,报道称Windows10、Windows11新版Copilot应用已摘掉Beta帽...

WinForm 双屏幕应用开发:原理、实现与优化

在当今的软件开发领域,多屏幕显示技术的应用越来越广泛。对于WinForm应用程序来说,能够支持双屏幕显示不仅可以提升用户体验,还能满足一些特定场景下的业务需求,比如在演示、监控或者多任务处理等场景...

推荐一个使用 C# 开发的 Windows10 磁贴美化小工具

...

OpenJDK 8 安装(openjdk 8 windows)

通常OpenJDK8和11都能互相编译和通用。我们建议使用11,但是如果你使用JDK8的话也是没有问题的。建议配置使用OpenJDK,不建议使用OracleJDK,主要是因为版...

基于 Linux 快速部署 OpenConnect VPN 服务(ocserv 实战指南)

一、前言在如今远程办公和内网穿透需求日益增长的背景下,搭建一套安全、稳定、高效的VPN系统显得尤为重要。OpenConnectServer(ocserv)是一个开源、高性能的VPN服务端软件...

巧妙设置让Edge浏览器更好用(edge怎么设置好用)

虽然现在新版本的Edge浏览器已经推出,但是毕竟还处于测试的状态中。而Win10系统里面自带的老版Edge浏览器,却越来越不被人重视。其实我们只需要根据实际情况对老版本的Edge浏览器进行一些简单的设...

WPF做一个漂亮的登录界面(wpf页面设计)

...

微软开源博客工具Open Live Writer更新:多项Bug修复

OpenLiveWriter前身是WindowsLiveWriter,是微软WindowsLive系列软件之一,曾经是博主们非常喜爱的一款所见即所得博文编辑工具,支持离线保存,还支持图像编辑...

基于OpenVINO的在线设计和虚拟试穿 | OPENAIGC大赛企业组优秀作品

在第二届拯救者杯OPENAIGC开发者大赛中,涌现出一批技术突出、创意卓越的作品。为了让这些优秀项目被更多人看到,我们特意开设了优秀作品报道专栏,旨在展示其独特之处和开发者的精彩故事。...

C#开源免费的Windows右键菜单管理工具

...

Windows10或11中隐藏的功能,用它再也不用担心电脑中病毒!

...

Python open函数详解(python open函数源码)

演示环境,操作系统:Win1021H2(64bit);Python解释器:3.8.10。open是Python的一个内置函数,一般用于本地文件的读写操作。用法如下。my_file=open(fi...

Windows 11 安装 Docker Desktop(Windows 11 安装助手 Windows 易升 关系)

...

Windows 11 新版发布:屏幕亮度自适应控制,小组件界面重新设计!

...

世界上最好用的Linux发行版之一,OpenSUSE安装及简单体验

背景之前无意在论坛里看到openSUSE的Linux发行版,被称为世界上最好用的Linux发行版之一(阔怕),一直想体验一下,于是这期做一个安装和简单体验教程吧。...

取消回复欢迎 发表评论: