数据库报表

sunjinyujeep 2009-10-13 03:13:42
SELECT rownumber() over(order by alldays desc,usercode) as rownum, z.code,z.type1,substr(z.endtime,1,10) as endtime,z.alldays,b.name,b.ocode,c.manufacturer,d.usercode,d.wdname,d.azdate ,d.bxdate ,d.status from (
select a.code,a.type1,max(a.endtime) as endtime,days(current date) - days(cast(substr(max(a.endtime),1,10) as date)) as alldays from pm_vwgj a
group by a.code,a.type1 ) as z
left join atm_type c on z.type1=c.tcode,bank b,sb_t d where d.usercode=b.bankcode and z.code=d.code and z.type1=d.type1
and (d.status='运行' or d.status='暂停' ) and d.pmconcernstatus<>2
and z.alldays >=60
and not exists (select * from atm_bank_right s where s.bankcode=d.usercode and righttype=2);

SELECT rownumber() over(order by alldays desc,usercode) as rownum, z.code,z.type1,substr(z.endtime,1,10) as endtime,z.alldays,b.name,b.ocode,c.manufacturer,d.usercode,d.wdname,d.azdate ,d.bxdate ,d.status from (
select a.code,a.type1,max(a.endtime) as endtime,days(current date) - days(cast(substr(max(a.endtime),1,10) as date)) as alldays from pm_vwgj a
group by a.code,a.type1 ) as z
left join atm_type c on z.type1=c.tcode,bank b,sb_t d where d.usercode=b.bankcode and z.code=d.code and z.type1=d.type1
and (d.status='运行' or d.status='暂停' ) and d.pmconcernstatus<>2
and z.alldays >=60
and exists (select * from atm_bank_right s where s.bankcode=d.usercode and righttype=2);
为什么第一个消耗的时间要比第二个长好多啊?
...全文
83 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
alan0128 2009-10-13
  • 打赏
  • 举报
回复
大哥第一次编译肯定比第二次长了

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧