ÇóPL/SQLµÄд·¨
±íA£¬Ê¹Óõ½µÄ×Ö¶ÎID£¬Ê±¼ä×Ö¶ÎTM£¬ÖµDRP
select ID,sum(drp) from A
where tm <to_date('2010-1-25 10:00:00','yyyy-mm-dd hh24:mi:ss') and tm>=to_date('2009-12-25 10:00:00','yyyy-mm-dd hh24:mi:ss')
group by ID
³öÀ´µÄÁбíΪ
ID,SUM(DRP)
1 0
2 10
3 20
........
select ID,sum(drp) from A
where tm <to_date('2010-1-25 10:00:00','yyyy-mm-dd hh24:mi:ss') and tm>=to_date('2009-11-25 10:00:00','yyyy-mm-dd hh24:mi:ss')
group by ID
³öÀ´µÄÁбíΪ
ID,SUM(DRP)
1 10
2 20
4 40
..........
ÏÖÇóÒ»SQL£¬Äܹ»Âú×ãÒÔÏÂÁбíµÄ½á¹û,¼´°´ID½«ÒÔÉÏÁ½¾äSQLµÄÖµºÏ²¢µ½ÁÐ
ID,SUM(DRP) M1,SUM(DRP) M2
1 0 10
2 10 20
3 20
4 40
.................
ºÃÏñÊÇÐÐÁÐת»»Ìù°É£¡Çë¿´Ò°ÀǵÄ×ܽáÌû×Ó°É£º
http://topic.csdn.net/u/20100109/13/6A10C168-F190-4766-B838-ADBF03C4AC7B.html
SELECT c.ID,sum(b.drp) M1,sum(c.drp) M2 from A b,A c
WHERE b.ID(+)=c.ID
AND b.tm <to_date('2010-1-25 10:00:00','yyyy-mm-dd hh24:m
Ïà¹ØÎÊ´ð£º
Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......