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

sql plus ³£ÓÃÃüÁî

showºÍsetÃüÁîÊÇÁ½ÌõÓÃÓÚά»¤SQL*Plusϵͳ±äÁ¿µÄÃüÁî
SQL> show all --²é¿´ËùÓÐ68¸öϵͳ±äÁ¿Öµ
SQL> show user --ÏÔʾµ±Ç°Á¬½ÓÓû§
SQL> show error¡¡¡¡ --ÏÔʾ´íÎó
SQL> set heading off --½ûÖ¹Êä³öÁбêÌ⣬ĬÈÏֵΪON
SQL> set feedback off --½ûÖ¹ÏÔʾ×îºóÒ»ÐеļÆÊý·´À¡ÐÅÏ¢£¬Ä¬ÈÏֵΪ"¶Ô6¸ö»ò¸ü¶àµÄ¼Ç¼£¬»ØËÍON"
SQL> set timing on --ĬÈÏΪOFF£¬ÉèÖòéѯºÄʱ£¬¿ÉÓÃÀ´¹À¼ÆSQLÓï¾äµÄÖ´ÐÐʱ¼ä£¬²âÊÔÐÔÄÜ
SQL> set sqlprompt "SQL> " --ÉèÖÃĬÈÏÌáʾ·û£¬Ä¬ÈÏÖµ¾ÍÊÇ"SQL> "
SQL> set linesize 1000 --ÉèÖÃÆÁÄ»ÏÔʾÐÐ¿í£¬Ä¬ÈÏ100
SQL> set autocommit ON --ÉèÖÃÊÇ·ñ×Ô¶¯Ìá½»£¬Ä¬ÈÏΪOFF
SQL> set pause on --ĬÈÏΪOFF£¬ÉèÖÃÔÝÍ££¬»áʹÆÁÄ»ÏÔʾֹͣ£¬µÈ´ý°´ÏÂENTER¼ü£¬ÔÙÏÔʾÏÂÒ»Ò³
SQL> set arraysize 1 --ĬÈÏΪ15
SQL> set long 1000 --ĬÈÏΪ80
˵Ã÷£º
longֵĬÈÏΪ80£¬ÉèÖÃ1000ÊÇΪÁËÏÔʾ¸ü¶àµÄÄÚÈÝ£¬ÒòΪºÜ¶àÊý¾Ý×ÖµäÊÓͼÖÐÓõ½ÁËlongÊý¾ÝÀàÐÍ£¬È磺
SQL> desc user_views
ÁÐÃû ¿É¿ÕÖµ·ñ ÀàÐÍ
------------------------------- -------- ----
VIEW_NAME NOT NULL VARCHAR2(30)
TEXT_LENGTH NUMBER
TEXT LONG
SQL> define a = '''20000101 12:01:01''' --¶¨Òå¾Ö²¿±äÁ¿£¬Èç¹ûÏëÓÃÒ»¸öÀàËÆÔÚ¸÷ÖÖÏÔʾÖÐËù°üÀ¨µÄ»Ø³µÄÇÑùµÄ³£Á¿£¬
--¿ÉÒÔÓÃdefineÃüÁîÀ´ÉèÖÃ
SQL> select &a from dual;
Ô­Öµ 1: select &a from dual
ÐÂÖµ 1: select '20000101 12:01:01' from dual
'2000010112:01:01
-----------------
20000101 12:01:01
ÎÊÌâÌá³ö£º
1¡¢Óû§ÐèÒª¶ÔÊý¾Ý¿âÓû§ÏµÄÿһÕÅ±í¶¼Ö´ÐÐÒ»¸öÏàͬµÄSQL²Ù×÷£¬Õâʱ£¬Ò»±é¡¢Ò»±éµÄ¼üÈëSQLÓï¾äÊǺÜÂé·³µÄ
ʵÏÖ·½·¨£º
SQL> set heading off --½ûÖ¹Êä³öÁбêÌâ
SQL> set feedback off --½ûÖ¹ÏÔʾ×îºóÒ»ÐеļÆÊý·´À¡ÐÅÏ¢
Áгöµ±Ç°Óû§ÏÂËùÓÐͬÒå´ÊµÄ¶¨Ò壬¿ÉÓÃÀ´²âÊÔͬÒå´ÊµÄÕæʵ´æÔÚÐÔ
select 'desc '||tname from tab where tabtype='SYNONYM';
²éѯµ±Ç°Óû§ÏÂËùÓбíµÄ¼Ç¼Êý
select 'select '''||tname||''',count(*) from '||tname||';' from tab where tabtype='TABLE';
°ÑËùÓзûºÏÌõ¼þµÄ±íµÄselectȨÏÞÊÚÓèΪpublic
select 'grant select on '||table_name||' to public;' from user_tables where ¡¶Ìõ¼þ¡·;
ɾ³ýÓû§Ï¸÷ÖÖ¶ÔÏó
select 'drop '||tabty


Ïà¹ØÎĵµ£º

SQLÓï¾äÓÅ»¯


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

Win7Ï°²×°SQL Server2005

ÔÚWin7Ï°²×°SQL2005¿ª·¢°æ£¬°²×°SQL Native ClientʱÌáʾ°²×°Öжϣ¬Ã»ÓÐÔÚÒ⣬ȻºóÔÚ°²×°SQL ServerʱÓÖÌáʾ“[Microsoft][SQL Native Client]¿Í»§¶Ë²»Ö§³Ö¼ÓÃÜ.SQL Server °²×°³ÌÐòÎÞ·¨Á¬½Óµ½Êý¾Ý¿â·þÎñ½øÐзþÎñÆ÷ÅäÖÃ.”жÔØSQL Native ClientÖØа²×°£¬»¹ÊÇÖжϣ¬ÐÞ¸´£¬Ò²Öжϣ¬ÔÙжÔØ£¬ÇåÀí×¢²á±í£¬ÖØ× ......

SQL ServerÀィMysqlÁ´½Ó·þÎñÆ÷µÄͼ½â

ÔÚSQL ServerÀィMysqlºÍOracleÊý¾Ý¿âÁ´½Ó»¹ÊDZȽÏÈÝÒ׵ģºÎÒÃÇÏÈÔÚ·þÎñÆ÷ÉÏ°²×°MysqlºÍOracleÊý¾Ý¿âÏà¹ØµÄODBCÇý¶¯³ÌÐò£¬ÔÚ[¹ÜÀí¹¤¾ß]->[Êý¾ÝÔ´(ODBC)]       ÉèÖÃϵͳDSN£¬ÈçÏÂͼ:     
 
ÉèÖúÃÁËÒÔºó£¬ÎÒÃÇ¿ÉÒÔÓÃSQL Server×Ô´øµÄµ¼³öºÍµ¼È빤¾ßÀ´Êµ ......

Ҳ̸SQL¸÷ÖÖÁ¬½Ó£¨JOIN£©

×î½ü¹«Ë¾ÔÚÕÐÈË£¬Í¬ÊÂÎÊÁ˼¸¸ö×ÔÈÏΪÊý¾Ý¿â¿ÉÒÔµÄӦƸÕß¹ØÓÚ¿âÁ¬½ÓµÄÎÊÌ⣬»Ø´ð²»¾¡ÀíÏë¡«
ÏÖÔÚÔÚÕâдд¹ØÓÚËüÃǵÄ×÷ÓÃ
¼ÙÉèÓÐÈçÏÂ±í£º
Ò»¸öΪͶƱÖ÷±í£¬Ò»¸öΪͶƱÕßÐÅÏ¢±í¡«¼Ç¼ͶƱÈËIP¼°¶ÔӦͶƱÀàÐÍ£¬×óÓÒÁ¬½Óʵ¼Ê˵ÊÇÎÒÃÇÁªºÏ²éѯµÄ½á¹ûÒÔÄĸö±íΪ׼¡«
1£ºÈçÓÒ½ÓÁ¬ right join »ò right outer join£º
ÎÒÃÇÒÔÓÒ±ß ......

ͨ¹ý·ÖÎöSQLÓï¾äµÄÖ´Ðмƻ®ÓÅ»¯SQL(ËÄ)

Î壺 ORACLEµÄÖ´Ðмƻ®
±³¾°ÖªÊ¶£ºÎªÁ˸üºÃµÄ½øÐÐÏÂÃæµÄÄÚÈÝÎÒÃDZØÐëÁ˽âһЩ¸ÅÄîÐÔµÄÊõÓ
 
¹²ÏísqlÓï¾ä
 
ΪÁ˲»Öظ´½âÎöÏàͬµÄSQLÓï¾ä(ÒòΪ½âÎö²Ù×÷±È½Ï·Ñ×ÊÔ´£¬»áµ¼ÖÂÐÔÄÜϽµ)£¬ÔÚµÚÒ»´Î½âÎöÖ®ºó£¬ORACLE½«SQLÓï¾ä¼°½âÎöºóµÃµ½µÄÖ´Ðмƻ®´æ·ÅÔÚÄÚ´æÖС£Õâ¿éλÓÚϵͳȫ¾ÖÇøÓòSGA(system global are ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ