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

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

Á½±í,
A ±í(¶©µ¥)
order style customer qty
1000 22 33 10
1000 22 33 -4
1000 22 33 -1
1000 44 33 8
1000 44 33 -4

B±í(Òѳö»õ)
order style customer qty
1000 22 33 2
1000 22 33 1
1000 44 33 3

ÏëµÃµ½ÒÔÏÂÊ£ÓàÁ¿

order style customer qty
1000 22 33 2
1000 44 33 1

лл!
 

  

SQL code:

select a.order,a.style,a.customer,(sum(a.qty)-sum(b.qty)) qty
from a,b
where a.order=b.order,a.style=b.style,a.customer=b.customer
group by a.order,a.style,a.customer





SQL code:

select a.order,a.style,a.customer, (a.qty-b.qty) as [qty]
from (select order,style,cusomer,sum(qty) as qty
from tb_a
group by order,style,cusomer) a left join (select order,style,cusomer,sum(qty) as qty
from tb_b
group by order,style,cusomer)b
on a.order=b.order and a.style=b.style and a.customer=b.customer





ÎÒ·¢ÏÖÎÒÊÇ×µÄ


Ïà¹ØÎÊ´ð£º

sqlÓï¾ä¶à±í¶à×ֶβéѯ - MS-SQL Server / »ù´¡Àà

ÎÒÓжà¸ö±íA B C ½á¹¹ÊÇÒ»ÑùµÄ£¬¶¼ÓÐ2¸ö×Ö¶ÎnameºÍcontent,ÎÒÒªËÑË÷ËùÒÔ±íËùÓÐ×Ö¶ÎÖаüº¬¡°Öйú¡±µÄÄÚÈÝ Õâ¸öSQLÓï¾äÔõôд 

ÈçºÎ½«¶à¸ö±íµÄ²éѯ½á¹ûÁ¬³ÉÒ»¸ö±í Õâ¸öSQLÓï¾äÔõôд ±íµÄ½á¹¹ÊÇÒ»ÑùµÄ
ÀýÈç£ ......

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

SQLÈçºÎÓÅ»¯ÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

½ñÌì×öÁËÒ»¸ö´æ´¢¹ý³Ì   »·¾³ÊÇSQL2000Êý¾Ý¿â  
´óÖÂÈçÏÂ
½¨Á¢ÁÙʱ±í
¶¨ÒåÔ±¹¤Óαê
        Ñ­»·Ô±¹¤£¨ÊôÓÚ1¸ö¹«Ë¾)  
        ......

sql - MS-SQL Server / ÒÉÄÑÎÊÌâ

sqlµÄÈí¼þÔÚÄÄÀï¿ÉÒÔϰ¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»Á˰¡

Ëæ±ã¸ãÒ»D°æ°É£¬

ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓÃ
2000,2005¶¼ÕâÑù

http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ