以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]用这种方法,我怎么找到最大的值? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=154109) |
-- 作者:zto001 -- 发布时间:2020/9/3 21:27:00 -- [求助]用这种方法,我怎么找到最大的值? Dim cmd As new SQLCommand cmd.ConnectionName = "sql" Dim dt As DataTable cmd.CommandText = "Select * From {G_Trade_Log} Where [RecID] Is null" \'生成空表 dt = cmd.ExecuteReader(True) \'记得将参数设置为True Dim dr As DataRow = dt.AddNew() dr("RecID") = RecID+1 dr("TradeID") = 行("TradeID") dr("Operator") = "当前操作人" dr("LogDetail") = "操作内容限120字" dr("LogTime") = Date.Now dt.Save() 我想问下,我怎么获取{G_Trade_Log} 这表最后一行(RecID的最大值)?
|
-- 作者:有点蓝 -- 发布时间:2020/9/3 21:30:00 -- cmd.CommandText = "Select top 1 * From {G_Trade_Log} order by [RecID] desc" |