有关ASP的仓库报表功能的一个疑问

来源:百度知道 编辑:UC知道 时间:2024/05/11 20:40:45
有关ASP的仓库报表功能的一个疑问?
就是我现在在做一个仓库管理系统,现在在报表功能上应该如何读取显示出产品库中所有不重复的货号编号数据。同时要查询到该货物编号对应的物品的其他信息。有没有这方便的教程啊!
我知道的一个语句是:
sql="select distinct huohao from produit"
这只是查询到了在produit库中不重复的所有huohao,我现在就是想要查询到该货号对应的其他的所有信息。
注:同一货号对应的参数除了库存数量(shulian)和库存位置(id_ku)其他的参数都一样,
一楼的不行啊!显示不出来!

很简单呀,既然你都查询到的到需要的货号了,一个In就搞定了啊!

select * from produit where huohao in (select distinct huohao from produit)

实际应用中,只要把前面的查询内容修改下就可以了,关键就是关联到的货号参数和你distinct出来的货号关系

不好意思看错了,我想了想,如果你是asp程序的话可以这样:
sql="select distinct huohao from produit"
set Hrs=Server.CreateObject("ADODB.RecordSet")
Hrs.Open SqlStr,conn,1,1
if Hrs.eof and Hrs.bof then
response.write "打开数据库失败"
Hrs.close
set Hrs=nothing
else
do while not Hrs.eof
sql="select * from produit where huohao="&Hrs("huohao")
set Prs=Server.CreateObject("ADODB.RecordSet")
Prs.Open SqlStr,conn,1,1
.........(这里加处理程序)
Prs.close
set Prs=nothing
Hrs.movenext
loop
Hrs.close
set Hrs=nothing
end if

没有测试,思路就是这样。