select l.DQ,count(dbo.table1.usernumber) as counts from
(select top 100 percent dq.id,dq.dq,lthd.hd from lthd,dq where lthd.dq=dq.dq group by dq.id,dq.dq,lthd.hd order by dq.id) as l,table1
where l.HD=substring(usernumber,1,7) and dbo.table1.insertdate between @b_times and @a_times and OrderState=@dzyf group by l.DQ,l.id order by l.id查询的数据大概有100多万,用我的这个语句在网站里总是查询不出来,请高手指点。
(select top 100 percent dq.id,dq.dq,lthd.hd from lthd,dq where lthd.dq=dq.dq group by dq.id,dq.dq,lthd.hd order by dq.id) as l,table1
where l.HD=substring(usernumber,1,7) and dbo.table1.insertdate between @b_times and @a_times and OrderState=@dzyf group by l.DQ,l.id order by l.id查询的数据大概有100多万,用我的这个语句在网站里总是查询不出来,请高手指点。
解决方案 »
- 如何写循环?
- 请问在如何限制<input type="File" > 可选文件的类型
- 在asp.net页面中是否可以访问asp页面中定义的session?
- 怎样放置临时数据(做过类试功能的帮忙一下!)~~~急!
- 有关Split方面的问题,请求帮忙!!!
- 在access中带两个参数的查询怎么没法调用?提示:“至少有一个参数没指定”,急,在线等待!!
- 微软竞争3大招数——引自《IT史记》
- 如何彻底卸载.net应用程序中的Crystal组件(急)
- 水晶报表Pull模式,出现"没将物件参数设定为物件的执行固体"错误
- asp.net用c#语言制作二维码报错GDI+ 中发生一般性错误。
- 大家帮我看看。急!
- 返回接口列表!!!
sql cookbook
select A.DQ,count(B.usernumber) as counts from
(select DISTINCT dq.id,dq.dq,lthd.hd from lthd,dq where lthd.dq=dq.dq ) A ,table1 B
where A.HD=substring(B.usernumber,1,7) and B.insertdate between @b_times and @a_times and B.OrderState=@dzyf group by A.DQ OrderState是那个表的?