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

SQL Server:½«ÁиüдÓÒ»¸ö±í´«µÝµ½ÁíÒ»¸ö±í

ÎÊ£ºÔõÑùÔÚÒ»¸öUPDATEÓï¾äÖÐʹÓñíBµÄÈý¸öÁиüбíAÖеÄÈý¸öÁУ¿
¡¡¡¡´ð£º¶ÔÕâ¸öÎÊÌ⣬Äú¿ÉÒÔʹÓÃÇ¿´óµÄ¹Øϵ´úÊý¡£±¾Ò³ÖеĴúÂë˵Ã÷ÁËÈçºÎ×éºÏʹÓÃfrom×Ó¾äºÍJOIN²Ù×÷£¬ÒÔ´ïµ½ÓÃÆäËû±íÖÐÊý¾Ý¸üÐÂÖ¸¶¨ÁеÄÄ¿µÄ¡£ÔÚÉè¼Æ¹Øϵ±í´ïʽʱ£¬ÄúÐèÒª¾ö¶¨ÊÇ·ñÐèÒªµ¥Ò»ÐÐÆ¥Åä¶à¸öÐУ¨Ò»¶Ô¶à¹Øϵ£©£¬»òÕßÐèÒª¶à¸öÐÐÆ¥Åä±»Áª½Ó±íÖеĵ¥Ò»ÐÐÒÔ¸üÐÂËùÓÐÐУ¨¶à¶ÔÒ»¹Øϵ£©¡£
¡¡¡¡ÔÚÒ»¶Ô¶à¹ØϵÖУ¬SQL ServerʼÖÕʹÓÃËüÕÒµ½µÄ×îºóÒ»ÐиüÐÂÊý¾Ý¡£µ«ÊÇ£¬ÄúÎÞ·¨¿ØÖÆ×îºóÒ»ÐÐËùÔÚµÄλÖá£ÔڶദÀíÆ÷µÄ¼ÆËã»úÉÏ£¬²éѯ¿ÉÄÜÊÇͬ²½½øÐеģ¬ÏàͬµÄ²éѯ×îºóÒ»ÐеÄλÖÿÉÄܻ᲻ͬ¡£Òò´Ë£¬Microsoft½¨Ò龡Á¿²»ÒªÊ¹ÓÃÒ»¶Ô¶à¹Øϵ¡£
¡¡¡¡Èç¹û´ý¸üеıíÓëfrom×Ó¾äÖеıíÏàͬ£¬²¢ÇÒfrom×Ó¾äÖ»°üº¬¶Ô¸Ã±íµÄÒ»¸öÒýÓ㬱ðÃû¿ÉÄÜδ±»Ö¸¶¨¡£Èç¹û´ý¸üеıíÔÚfrom×Ó¾äÖгöÏÖÁ˶à´Î£¬Ö»ÓиñíµÄÒ»¸öÒýÓÿÉÒÔÊ¡ÂÔ±íµÄ±ðÃû£¬¶Ô¸Ã±íµÄËùÓÐÆäËûÒýÓñØÐë°üº¬Ò»¸ö±í±ðÃû¡£
USE tempdb
GO
CREATE TABLE #t1 (c1 int NOT NULL, c2 char(5), c3 char(5),
 c4 char(5))
GO
CREATE TABLE #t2 (c1 int NOT NULL, c2 char(5), c3 char(5),
 c4 char(5))
GO
--Êý¾Ý¸³Öµ
INSERT #t1 values (1,'hello','there','fred')
INSERT #t2 values (1,'how','are','you?')
--¸üÐÂÊý¾Ý
UPDATE #t1 SET #t1.c2 = #t2.c2, #t1.c3 = #t2.c3,
 #t1.c4 = #t2.c4
from #t2
WHERE #t1.c1 = #t2.c1
--¼ì²é½á¹û
SELECT * from #t1


Ïà¹ØÎĵµ£º

sql×¢Èë

Ê×ÏÈÎÒÏëлл԰×ÓµÄÅóÓÑÃÇ£¬ÊÇÄãÃÇÌáÐÑÎÒдÄÚÈÝÓдíÎ󣬼ǵÃÔø¾­µç×ÓÉÌÎñÖ®Êý¾Ý´æ´¢Á÷³Ì£¨Î壩ÀïÃæ˵µ½“Ñ¡´æ´¢¹ý³Ì+´«µÝ²ÎÊýÓÃSqlParameterÊÇÒòΪ£¬³ý·ÇÊÇADO.NETÓЩ¶´£¬ÄÇô¾Í¾ø¶Ô²»»á·¢ÉúSQL×¢È딡£Keep Walking´ó¸çÒ²ÔÚ¹ØÓÚ·ÀÖ¹sql×¢ÈëµÄ¼¸ÖÖÊֶΣ¨¶þ£©ÖоٳöÀ´Ò»¸öÀý×Ó˵Ã÷ÎÒ˵µÄÉϾ仰ÊÇ´íÎóµÄ¡£ËµÊµ»°µ± ......

SQL Óë ORACLE µÄ±È½Ï (ת)


01¡¢SQLÓëORACLEµÄÄÚ´æ·ÖÅä
ORACLEµÄÄÚ´æ·ÖÅä´ó²¿·ÖÊÇÓÉINIT.ORAÀ´¾ö¶¨µÄ£¬Ò»¸öÊý¾Ý¿âʵÀý¿ÉÒÔÓÐNÖÖ·ÖÅä·½°¸£¬²»Í¬µÄÓ¦Óã¨OLTP¡¢OLAP£©ËüµÄÅäÖÃÊÇÓвàÖصġ£ SQL¸ÅÀ¨ÆðÀ´Ëµ£¬Ö»ÓÐÁ½ÖÖÄÚ´æ·ÖÅ䷽ʽ£º¶¯Ì¬ÄÚ´æ·ÖÅäÓ뾲̬ÄÚ´æ·ÖÅ䣬¶¯Ì¬ÄÚ´æ·ÖÅä³äÐíSQL×Ô¼ºµ÷ÕûÐèÒªµÄÄڴ棬¾²Ì¬ÄÚ´æ·ÖÅäÏÞÖÆÁËSQL¶ÔÄÚ´æµÄʹ Óá£
002¡¢SQ ......

SQL¼òÊö

¡¡¡¡20ÊÀ¼Í£¸£°Äê´ú³õ£¬ANSI£¨American¡¡National¡¡Standard¡¡Institute£©¡¡Êý¾Ý¿â±ê׼ίԱ»á¿ªÊ¼Öƶ©Ïà¹Ø¹ØϵÓïÑԵıê×¼£¬µ«Ö±µ½£±£¹£¸£¶Ä꣬Êý¾Ý¿â±ê׼ίԱ»á²ÅÍƳöµÚÒ»¸öSQLÓïÑÔ±ê×¼SQL-86¡£Ëæ×ÅÊý¾Ý¿â¼¼ÊõµÄ·¢Õ¹£¬SQL±ê×¼Ò²ÔÚ²»¶Ï½øÐÐÀ©Õ¹ºÍÐÞÕý£¬²¢ÇÒÊý¾Ý¿â±ê׼ίԱ»áÏȺóÓÖÍƳöSQL-89£¬SQL-92ÒÔ¼°SQL-99±ê×¼¡££±£¹£·£ ......

oracle vs. SQL ͬÒå´Êsynonym ±ðÃû alias

oracle ͬÒå´Ê synonym ΪÊý¾Ý¿â¶ÔÏó½¨Á¢Í¬Òå´Êºó,µ±dba¶ÔÊý¾Ý¿â¶ÔÏó(table,view,ÐòÁÐ)×öÁËÒ»¸ö¼òµ¥¸Ä¶¯Ö®ºó,ÈçÃû×Ö»òÕ߽ṹ¸Ä±ä,Ôò²»ÐèÒªÖØиü¸Ä²¢±àÒëÓ¦ÓÃ.ÔÚÊý¾Ý¿â×ÖµäÖÐÓж¨Òå,²»ÐèÒª½øÐÐÈκδ洢.
oracle±ðÃûalias,With as¡¡Éú³ÉÒ»¸öÁÙʱ±í£¬¶ÔÓÚ¸´ÔÓµÄÊý¾Ý²éѯ£¬¿ÉÒÔ¼õÉÙ×ÊÔ´ÏûºÄ¡¢Ìá¸ßÐÔÄÜ¡£9iÒýÈë¡£
with alias ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ