Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÇòÒ»¾äsql - .NET¼¼Êõ / ASP.NET

table A

id income
1 120
2 211
3 116
........


table sum

id total
1 120 --1
2 331 --1+2
3 447 --1+2+3
........


ÈçºÎ°´Ìì»ã×ÜÒÔÀ´µÄÊÕÈ룬sqlÔõôд
select sum(Income) from Table
where Date between StartDate and EndDate

§Ö÷±íÊö²»Çå³þ°¡¡£¡£¡£¡£¡£¡£ÉÏÃæµÄ¾ÍÊÇsumÁË£¬×Ô¼º¸ãÇå³þÁ˺ܺÃдµÄ£¬ÎÞ·ÇÊÇgroup byºÍinner joinÖ®ÀàµÄ¡£¡£¡£



1 120 
2 331 
3 447 

Õâ¸öÊǸù¾Ýtable A Êä³öµÄsum±í


ÒýÓÃ
SQL code
DECLARE @t TABLE (id int,income int)
INSERT INTO @t
SELECT 1 ,120
UNION ALL SELECT 2, 211
UNION ALL SELECT 3 ,116


SELECT b.id,
(SELECT SUM(a.income) from @t a WHERE a.id<=b.id¡­¡­


ÓαêÒ²¿ÉÒÔ£¬²»¹ýÂ¥Éϵĸü¼ò½àµã¡£

ÒýÓÃ
SQL code
DECLARE @t TABLE (id int,income int)
INSERT INTO @t
SELECT 1 ,120
UNION ALL SELECT 2, 211
UNION ALL SELECT 3 ,116


SELECT b.id,
(SELECT SUM(a.income) from @t a WHERE a.id<=b.id¡­¡­


ѧϰ¡­¡­

¹þ¹þ£¬Ã÷°×ÁË

¶ÔÁË£¬ÄÇselect * from aÈçºÎ¸³¸ø@tÄØŶ£¡

Çë½ÌLZ
¿É²»¿ÉÒÔ¸øÎÒÉÔ΢½²Ò»ÏÂ
¡°SELECT b.id, 
  (SELECT SUM(a.income) from @t a


Ïà¹ØÎÊ´ð£º

ÔÚasp.netÀïÃæ½Å±¾³ö´í - .NET¼¼Êõ / ASP.NET

function CheckOpwd(){//ÑéÖ¤Óû§Ãû
var pwd=document.all.txtOpwd;

var div1=document.getElementById("divPwd");

if (pwd.value=="")
{
......

sqlССµÄÒÉÎÊ - .NET¼¼Êõ / C#

¿ÉÄÜÒòΪ¹¤×÷µÄÔ­Òò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......

wapÍøÕ¾¿ª·¢µÄÎÊÌâ - .NET¼¼Êõ / ASP.NET

ÎÒÓÃ.net¿ª·¢wapÍøÕ¾
1£¬ÎÒ´Ó¹¤¾ßÏäÀïÍÏÁËÁ½¸ölink£¬ÕâÁ½¸ölink»áÏÔʾÔÚÁ½ÐУ¬Èç¹ûÈÃÕâÁ½¸ölink´¦ÓÚͬһÐС£
2£¬ÈçºÎÏÔʾÁ½¸ö¿Ø¼þÖ®¼äµÄ¿Õ¸ñÎÊÌâ¡£
¸úwapÓйØÂ𣿲»Ì«Ã÷°×

ÓÑÇé°ï¶¥¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£

¾Í ......

asp.netÈçºÎÌá¸ß·ÃÎÊËÙ¶È - .NET¼¼Êõ / ASP.NET

ÎÒ×î½ü×öÁËÒ»¸öÍøÕ¾ÊǹØÓÚ²úƷչʾµÄ ~ Õû¸öÍøվͼƬ¶¼Õ¼ÓÃÁËÒ»´ó°ë  
ÕâÑùµÄ»°·ÃÎÊËٶȾͷdz£Âý ÓÐʲô°ì·¨¿ÉÒÔ½â¾öÂð£¿
Âé·³´ó¼Ò¶à¶à¸øµãÒâ¼û £¡ ÓÐʲô¾¡¹Ü˵ 
3Q´ó¼Ò
htmlÒ³Ãæ.

Õâ¸ö,¼ÈÈ»Ö÷Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ