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

Excelµ¼Èëµ½SQLµÄÒ»¸öÐÂ˼·

/*
±ÈÈçExcelÓÐÁ½ÁУ¬AÁкÍBÁÐÐèÒªµ¼Èëµ½SQL±íÖУ¬·´ÕýÎÒÒѾ­Óм¸Äê²»ÓÃDTSÖ®ÀàµÄ¹¤¾ßÁË¡£
ÔÚExcelÖеÄеÄÒ»ÁÐÖУ¬Ö±½Óд¹«Ê½
=CONCATENATE("Insert #tmp values('",A1,"','",B1,"')")
°ÑÿһÐж¼Éè³ÉͬÑùµÄ¹«Ê½(Ë«»÷¼´¿ÉÍê³É)¡£
°ÑÕûÁи´ÖÆÏÂÀ´£¬·Åµ½²éѯ·ÖÎöÆ÷ÖÐÖ±½ÓÔËÐоͺÃÁË¡£
Ò²¿ÉÒ԰ѹ«Ê½¸Ä³É =CONCATENATE("select '",A1,"','",B1,"' Union all")
ÕâÑùµÄºÃ´¦¶à
1: ²»ÓùÜÄãʲô¸ñʽ£¬¾ø¶Ô²»»áÂÒ¡£
2£º¿ì½Ý·½±ã£¨ÁÐÊý²»Ì«¶àµÄ»°Ò»°ãÒ»·ÖÖÓÖ®ÄÚ¿ÉÒԸ㶨£©
3: ²»»á³ö´í£¬ÉõÖÁ¶¼²»ÐèÒªºË¶Ô¡£
......
*/
ת×Ô£ºhttp://topic.csdn.net/u/20091020/08/2162e737-577f-4f0c-9a4c-592ba97c698c.html?seed=1969593865&r=60535884#r_60535884


Ïà¹ØÎĵµ£º

ʹÓÃSQLServerÄ£°åÀ´Ð´¹æ·¶µÄSQLÓï¾ä

Èç¹ûÄã¾­³£Óöµ½ÏÂÃæµÄÎÊÌ⣬Äã¾ÍÒª¿¼ÂÇʹÓÃSQL ServerµÄÄ£°åÀ´Ð´¹æ·¶µÄSQLÓï¾äÁË£º
SQL³õѧÕß¡£
¾­³£Íü¼Ç³£ÓõÄDML»òÊÇDDL SQL Óï¾ä¡£
ÔÚ¶àÈË¿ª·¢Î¬»¤µÄSQLÖУ¬Ã¿¸öÈ˶¼ÓÐ×Ô¼ºµÄSQLÏ°¹ß£¬Ã»ÓÐÒ»Ì×ͳһµÄ¹æ·¶¡£
ÔÚSQL Server Management StudioÖУ¬ÒѾ­¸ø´ó¼ÒÌṩÁ˺ܶೣÓõÄÏÖ³ÉSQL¹æ·¶Ä£°å¡£
SQL Server Management ......

¾­µäSQL£¨2£©

1¡¢¾­µäµÄ²éѯÓï¾ä
2¡¢¾­µäµÄ×Ö¶¨Ò庯Êý
3¡¢¾­µäµÄÓëÒµÎñÏà¹ØµÄ´æ´¢¹ý³Ì
µÈµÈ
1¡¢ ¸ú×Ùµ±Ç°¶Ô»°ÏÂÓû§µÄSQL½Å±¾
select sql_text from v$sqltext_with_newlines where (hash_value,address)
in (select sql_hash_value,sql_address from v$session where sid=&sid)
order by address,piece;
SID
ÓÉÕâ ......

oracle SQLÐÔÄÜÓÅ»¯

ÎÒÃÇÒª×öµ½²»µ«»áдSQL,»¹Òª×öµ½Ð´³öÐÔÄÜÓÅÁ¼µÄSQL,ÒÔÏÂΪ±ÊÕßѧϰ¡¢ÕªÂ¼¡¢²¢»ã×ܲ¿·Ö×ÊÁÏÓë´ó¼Ò·ÖÏí£¡
£¨1£©      Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£ ......

ͨ¹ýSQL½«ÎļþÄÚÈÝ´æÈë×Ö¶Î

ËäȻֱ½Ó½«ÎļþÄÚÈÝ´æÈëÊý¾Ý¿â×ֶεÄÇé¿ö²»¶à£¬²»¹ýÔÚ¶ÔÓÚÎļþÄÚÈݻᷢÉú±ä»¯µÄÇé¿öÏ´æÈëÊý¾Ý¿â×Ö¶ÎÒ²²»Ê§ÎªÒ»ÖÖ·½·¨¡£
Æäʵ·½·¨ºÜ¼òµ¥£¬ÕâÀïÓõ½Ò»¸öload_fileº¯Êý£¬²»ÖªµÀÊDz»ÊÇÎÒϵÄMYSQLÊÖ²áÓÐÎÊÌâ¡£ÎÒÔÚÕÒÕâ¸öº¯ÊýµÄʱºòË÷ÒýºÍÄÚÈݲ»¶ÔÓ¦¡£
Ê×ÏÈÊǽ¨±íÓï¾ä
 create table test (id int,file blob);
²åÈëÓï¾ ......

SQl Óï¾ä(³£¼û) н¨,ɾ³ý,Ð޸ıí½á¹¹

н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ