注册 登录
编程论坛 ASP技术论坛

asp怎样显示数据库中同一字段的最大列和最小列

dhdhzzw 发布于 2008-02-02 13:47, 973 次点击
SELECT MAX(company) FROM Sales WHERE account='www'
这种查询语句结果,怎样在asp中输出?
4 回复
#2
madpbpl2008-02-02 14:25
Response.Write (rs("MAX(ComPany)"))
#3
dhdhzzw2008-02-02 14:35
madpbpl  你这样写对么?
Response.Write (rs("MAX(ComPany)"))
书记库中又没有这个字段阿
  <%                                               set rs=Server.CreateObject("Adodb.Recordset")
sql="select Max(company) from newupdate where account='"&username&"'"
 rs.open sql,conn,1,1
[bo]Response.Write (rs("MAX(ComPany)"))[/bo]response.end()
   %>
不显示任何结果,但数据库中已有多条记录。。。。。!??是不是有别的写法就像返回总列数用
rs.recordcount
#4
dhdhzzw2008-02-02 15:02
自己顶,版主一定要回答啊。。。。
#5
yms1232008-02-02 16:15
<%                                               set rs=Server.CreateObject("Adodb.Recordset")
sql="select Max(company) from newupdate where account='"&username&"'"
rs.open sql,conn,1,1
Response.Write (rs.Fields(0).Value)response.end()
   %>
这个一定有结果,除非数据库里没有相关数据。
1