sql语句如何写入ASP语句中
我想用ASP+SQL写个关于连续号码断点盘存的页面,但总通不过,请指点:ID PZLB PZHM
1 AA 1001
2 AA 1003
3 AA 1004
4 AA 1007
5 AA 1008
6 BB 1010
想显示结果为:
PZLB Start_HM End_HM
AA 1001 1001
AA 1003 1004
AA 1007 1008
BB 1010 1010
可在ASP中如下句子通不过
set rs=server.createobject("adodb.recordset")
sql="SELECT b.PZLB, MIN (b.PZHM) Start_HM, MAX (b.PZHM) End_HM"&_
"FROM (SELECT a.*, TO_NUMBER (a.PZHM - ROWNUM) cc"&_
"FROM (SELECT *"&_
"FROM GNH"&_
"ORDER BY PZLB, PZHM) a) b"&_
"GROUP BY b.PZLB, b.cc"
rs.open sql,conn,1,1
补充:.NET技术 , ASP.NET