网站首页 > 资源文章 正文
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()
%>
猜你喜欢
- 2025-05-08 ORACLE 体系 - 12(上)(oracle数据库体系)
- 2025-05-08 TiDB 专用语法,优化器注释和表属性
- 2025-05-08 22、ORM框架(orm的框架)
- 2025-05-08 回答:我不小心把公司的数据库给删了,该不该离职?
- 2025-05-08 MySQL三大日志:binlog、redolog、undolog全解析
- 2025-05-08 数据库基础详解:存储过程、视图、游标、SQL语句优化以及索引
- 2025-05-08 Dify工具使用全场景:彩票信息保存入库 (应用篇·第2期)
- 2025-05-08 MySQL体系架构(mysql数据库架构图)
- 2025-05-08 看这篇就够了!MySQL 索引知识点超全总结
- 2025-05-08 orcl数据库查询重复数据及删除重复数据方法
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 电脑显示器花屏 (79)
- 403 forbidden (65)
- linux怎么查看系统版本 (54)
- 补码运算 (63)
- 缓存服务器 (61)
- 定时重启 (59)
- plsql developer (73)
- 对话框打开时命令无法执行 (61)
- excel数据透视表 (72)
- oracle认证 (56)
- 网页不能复制 (84)
- photoshop外挂滤镜 (58)
- 网页无法复制粘贴 (55)
- vmware workstation 7 1 3 (78)
- jdk 64位下载 (65)
- phpstudy 2013 (66)
- 卡通形象生成 (55)
- psd模板免费下载 (67)
- shift (58)
- localhost打不开 (58)
- 检测代理服务器设置 (55)
- frequency (66)
- indesign教程 (55)
- 运行命令大全 (61)
- ping exe (64)
本文暂时没有评论,来添加一个吧(●'◡'●)