Sql Server È¥ÖØ¸´Êý¾Ý
ÎÒµÄÊý¾Ý¿âÖÐÓÐÒ»¸öOrder±í ÀïÃæ×Ö¶ÎΪ
orderId amount qty
100100 -100 -1
100100 100 1
ÏÖÔÚ ÎÒÏë²éѯʱ È¥µôÕâÁ½ÌõÊý¾Ý ²»ÊÇɾ³ý Ö»ÊÇÏë²éѯʱ½«ÕâÁ½ÌìÊý¾ÝͬʱÌÞ³ý
Á½Ìõ¶¼È¥µô??
SQL code:
select *
from [Order] t
where exists(select 1
from [Order]
where orderId=t.orderId
group by orderId having count(*)=1)
select * from Order
where orderId<>100100 and (( amount<>-100 andqty<>-1)
or (amount<>100 andqty<>1))
Á½Ìõ¶¼È¥µô??
SQL code:
select * from Order group by orderId,amount,qty having count(*)=1
select * from tb t where not exists(select 1 from tb where (orderId=t.orderId and t.amount<>amount) or (orderId=t.orderId and amount<>t.amount))
SQL code:
select * from Order a
where not exists(select 1 from Order where a.orderId=orderId group by orderId having count(*)>=2)
SQL code:
select order
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
¿ÉÄÜÒòΪ¹¤×÷µÄÔÒò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......
ÄÄλÈÊÐÖÓй¦ÄÜÍêÕû¿ÉÓõÄSQLÏÂÔØµØÖ·ÄØ£¬ÎÒÓÐÒ»¸öµØÖ·£¬µ«Êǰ²×°ºó¹¦Äܲ»ÍêÕûÎÞ·¨Ê¹Óã¨Ã»ÓзþÎñÆ÷£©ÎÒÖªµÀµÄµØÖ·ÊÇ
http://down.xlylw.com/downlist/s_66_1.html
¿´À´£¬ÄãÖ»Äܵ½ÍøÉÏ×Ô¼ºËÑË÷ÁË!
×Ô¼º¶¯ÊÖ¾Í¿É ......