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

sql serverÒ»¸öʹÓÃÓαêµÄʵÀý

--´´½¨Óαê
DECLARE Cursor1 CURSOR FOR
SELECT NODE_NO,NODE_VALUE,SUM(RESALE_SUM-RESALERETU_SUM+SALE_SUM-SALERETU_SUM) sale_sum,
SUM(STORE_SUM) sum_store,SUM(STORE_SUM) store_sum,
sum(RESALE_PROFIT-RESALERETU_PROFIT+SALE_PROFIT-SALERETU_PROFIT-ADJUST_PROFIT) sale_profit
from tiger.BUSINESSREPORT20090702,tiger.GOODSINFO,tiger.PROD_TREE_MAST
WHERE RPT_GOODSNO=GDS_NO AND left(GDS_RIVALSHOP,4)=NODE_NO AND GDS_GRADE=3
GROUP BY NODE_NO,NODE_VALUE --´ò¿ªÓαê
OPEN Cursor1; --¶¨Òå±äÁ¿
declare @node_no char(20),
@node_value char(50),
@sale_sum VARCHAR(20),
@sum_store VARCHAR(20),
@store_sum VARCHAR(20),
@sale_profit VARCHAR(20) --È¡Êý¾Ý
fetch NEXT from Cursor1 into @node_no,@node_value,@sale_sum,@sum_store,@store_sum,@sale_profit while(@@fetch_status=0)
begin
    UPDATE tmp_node0615 SET RESALESUM20090702=ISNULL(@sale_sum,0),COUNT20090702=ISNULL(@store_sum,0) ,PROFIT20090702=ISNULL(@sale_profit,0) WHERE NODENO=@node_no;
    UPDATE tmp_node0615 SET SUMSTOCK=SUMSTOCK+COUNT20090702 WHERE NODENO=@node_no;
    fetch next from Cursor1 into @node_no,@node_value,@sale_sum,@sum_store,@store_sum,@sale_profit
end --¹Ø±ÕÓαê
close Cursor1 --ɾ³ýÓαê×ÊÔ´
deallocate Cursor1
GO


Ïà¹ØÎĵµ£º

PL/SQL DeveloperʹÓü¼ÇÉ

 1¡¢PL/SQL
Developer¼ÇסµÇ½ÃÜÂë
   ÔÚʹÓÃPL/SQL
Developerʱ£¬ÎªÁ˹¤×÷·½±ãÏ£ÍûPL/SQL
Developer¼ÇסµÇ¼OracleµÄÓû§ÃûºÍÃÜÂ룻
ÉèÖ÷½·¨£ºPL/SQL
Developer 7.1.2 
->tools->Preferences->Oracle->Logon History £¬ “Store
history”ÊÇĬÈϹ´Ñ¡µÄ£¬¹´ÉÏ&ldqu ......

DB2 SQL/XMLʹÓÃ

º¯Êý£º
XMLPARSE£º½âÎö×Ö·û»òÕß´ó¶ÔÏó¶þ½øÖÆÊý¾Ý£¬²úÉúXML
XMLSERIALIZE£º½«XMLֵת»»Îª×Ö·û»òÕß´ó¶ÔÏó¶þ½øÖÆÊý¾Ý
XMLVALIDATE£º¸ù¾ÝXML schemaУÑéXMLÖµµÄÓÐЧÐÔ
XMLEXISTS£º¼ì²âXQueryÊÇ·ñ·µ»Ø½á¹û£¨ÈçÓÉÒ»¸ö»ò¶à¸öÏîËù×é³ÉµÄÐòÁУ©
XMLQUERY£ºÖ´ÐÐÒ»¸öXQuery²¢ÒÔÒ»¸öÐòÁзµ»Ø½á¹û
XMLTABLE£ºÖ´ÐÐÒ»¸öXQuery£¬ÒÔ¹ØÏ ......

SQL Server Êý¾Ý¿âÓÅ»¯·½·¨ (Ò»)

¡¡¡¡ÎÒ¾­³£Åöµ½ÓÐÈË»áÎÊһЩÊý¾Ý¿âÓÅ»¯·½ÃæµÄÎÊÌ⣬ÎÒ¾õµÃÕâÊÇÒ»×î»ù±¾¼¼ÄÜÒªÇó£¬ÌرðÊÇʹÓÃsql server 2005£¬¶ÔÓÚsql serverµÄÓÅ»¯£¬Ê¹ÓõÄרְdba»ò¼æÖ°dbaÃǹ¤×÷¸üÇáËÉ£¬Ð§Âʸü¸ßÁË£¬µ«ÊÇ»¹ÊÇÓкܶàÐÂÈË¿ÉÄܲ»´óÁ˽⣬ÎÒÔÚÕâ¶ùдһÏÂ×î»ù±¾µÄһЩ½éÉÜ¡£
¡¡¡¡Ò»¡¢Ê×ÏȽéÉÜÒ»ÏÂsql server 2005ÖÐÓÅ»¯Êý¾ÝʱʹÓõ½µÄÁ½¸ö¹¤ ......

SQL Server2005 SynonymµÄʹÓÃ

--> Title  : SQL Server2005 SynonymµÄʹÓÃ
--> Author : wufeng4552
--> Date   : 2009-10-30
1.SynonymµÄ¸ÅÄî
¡¡  Synonym£¨Í¬Òå´Ê£©ÊÇSQL Server 2005µÄÐÂÌØÐÔ¡£¿ÉÒÔ¼òµ¥µÄÀí½âSynonymΪÆäËû對ÏóµÄ±ðÃû¡£
語·¨
CREATE SYNONYM [ schema_name_1. ] synonym_name FOR & ......

ÕâÑùµÄsql£¬ÎÒÈ´×öµ½ÁË¡£

 ÕâÊÇÒ»¸öCSDN Oracle¿ª·¢°æ¿éÀÍøÓÑÎʹýµÄÒ»µÀÌâ
ÌâÈçÏÂ
create table A_TEST
(
PAYOUT_ITEM_CODE VARCHAR2(30) not
null,
FORMULA_DET VARCHAR2(1000)
)
create table B_TEST
(
ELEMENT_ID VARCHAR2(5) not null,
NAME VARCHAR2(41)
)  
Çóдoracle¶à¸ö×Ö·ûÌæ»»£¨ÓвâÊÔÊý¾Ý£©
inser ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ