前端开发入门到精通的在线学习网站

网站首页 > 资源文章 正文

获取每个id最新日期的工作步骤(获取id地址点击登录)

qiguaw 2025-05-08 20:53:05 资源文章 4 ℃ 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()

%>

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表