oracle sql µÄÓï¾ä
delete ɾ³ýÒ»ÕÅ´ó±íʱ¿Õ¼ä²»ÊÍ·Å£¬·Ç³£ÂýÊÇÒòΪռÓôóÁ¿µÄϵͳ×ÊÔ´£¬Ö§³Ö»ØÍ˲Ù×÷£¬¿Õ¼ä»¹±»ÕâÕűíÕ¼ÓÃ×Å¡£
truncate table ±íÃû (ɾ³ý±íÖмǼʱÊͷűí¿Õ¼ä)
DML Óï¾ä£º
±í¼¶¹²ÏíËø£º ¶ÔÓÚ²Ù×÷Ò»ÕűíÖеIJ»Í¬¼Ç¼ʱ£¬»¥²»Ó°Ïì
Ðм¶ÅÅËüËø£º¶ÔÓÚÒ»ÐмǼ£¬oracle »áÖ»ÔÊÐíÖ»ÓÐÒ»¸öÓû§¶ÔËüÔÚͬһʱ¼ä½øÐÐÐ޸IJÙ×÷
wait() µÈµ½Ðм¶Ëø±»ÊÍ·Å£¬²Å½øÐÐÊý¾Ý²Ù×÷
dropÒ»ÕűíʱҲ»á¶Ô±í¼ÓËø£¬DDLÅÅËüËø,ËùÒÔÔÚɾ³ýÒ»ÕűíʱÈç¹ûµ±Ç°»¹ÓÐÓû§²Ù×÷±íʱ²»ÄÜɾ³ý±í
alter table ÃüÁîÓÃÓÚÐ޸ıíµÄ½á¹¹(ÕâЩÃüÁî²»»á¾³£ÓÃ)£º
Ôö¼ÓÔ¼Êø£º
alter table ±íÃû add constraint ¡¡Ô¼ÊøÃû primary key (×ֶΣ©;
½â³ýÔ¼Êø£º(ɾ³ýÔ¼Êø)
alter table ±íÃû drop primary key£¨¶ÔÓÚÖ÷¼üÔ¼Êø¿ÉÒÔÖ±½ÓÓô˷½·¨£¬ÒòΪһÕűíÖÐÖ»ÓÐÒ»¸öÖ÷¼üÔ¼ÊøÃû, ×¢ÒâÈç¹ûÖ÷¼ü´Ëʱ»¹ÓÐÆäËü±íÒýÓÃʱɾ³ýÖ÷¼üʱ»á³ö´í£©
alter tbale father drop primary key cascade ; (Èç¹ûÓÐ×Ó±íÒýÓÃÖ÷¼üʱ£¬ÒªÓôËÓï·¨À´É¾³ýÖ÷¼ü,Õâʱ×Ó±í»¹´æÔÚÖ»ÊÇ×Ó±íÖеÄÍâ¼üÔ¼Êø±»¼°ÁªÉ¾³ýÁË£©
alter table ±íÃû drop constraint Ô¼ÊøÃû;
(ÔõÑùÈ¡Ò»¸öÔ¼ÊøÃû£º1¡¢ÈËΪµÄÎ¥·´Ô¼Êø¹æ¶¨¸ù¾Ý´íÎóÐÅÏ¢»ñÈ¡!
2¡¢²éѯʾͼ»ñÈ¡Ô¼ÊøÃû!)
alter table ±íÃû disable from primary key ; (Ï൱ÓÚ°ÑÒ»¸ö±íµÄÖ÷¼ü½ûÓÃ)
alter table ±íÃû enable primary key ;£¨enable ʱ»á×Ô¶¯È¥¼ì²é±íµÄ¼Ç¼ÊDz»ÊÇ·ûºÏÒªÇó,Èç¹ûÓÐÔàÊý¾Ýʱ±ØÐëÒªÏÈɾ³ýÔàÊý¾Ý²Å¿ÉÒÔ enable£©
*******************************************************************
Ôö¼Ó×ֶΣº
alter table ¡¡¡¡±íÃû¡¡¡¡¡¡add(×Ö¶Î×Ö ×Ö¶ÎÀàÐÍ)
ɾ³ý×ֶΣº
alter table ¡¡¡¡±íÃû drop(×Ö¶Î)
alter tbale ±íÃû drop column ×ֶΠ; (8i ÒÔºó²ÅÖ§³Ö£©
¸øÁиÄÃû:920²ÅÖ§³Ö
alter table ±íÃû rename column ¾É×Ö¶ÎÃû to ÐÂ×Ö¶ÎÃû;
ÐÞ¸Ä×Ö¶Î
(´ËʱӦעÒâµÄÎÊÌ⣬¸ü¸ÄʱҪ¿´¾ßÌåÖµÇé¿öÖ®¼äµÄת´ï»»£¬¡¡¸ÄΪ×Ö·ûÀàÐÍʱ£¬±ØÐëҪΪ¿Õ)
alter table ¡¡±íÃû modify( ×ֶΣ¬ÀàÐÍ)
¸ü¸Ä±íÖеÄ×ֶΣº
update ±íÃû set ×ֶΠ£½ Öµ where Ìõ¼þ
¸ü¸Ä±íÃû
rename ¾É±íÃû to ¡¡ ¡¡Ð±íÃû £»
ɾ³ý±í£º
trucate table ±íÃû:(±í½á¹¹»¹ÔÚ£¬Êý¾ÝÈ«²¿É¾³ý£¬ÊͷűíËùÕ¼µÄ¿Õ¼ä£¬²»Ö§³Ö»ØÍË,³£ÓÃɾ³ý´ó±í£©
¹ØÓÚoralceÖвúÉúÐòÁÐ(sequence):
create sequence ÐòÁÐÃûalter system flush shared_pool;
(²»´ø²ÎÊýʱĬÈÏΪ´Ó1 ¿ªÊ¼Ã¿´ÎµÝÔö 1£¬o
Ïà¹ØÎĵµ£º
¿ªÆô£º
net start oracledbconsoleorcl
net start oracleOraDb10g_home1iSQL*Plus
net start oracleOraDb10g_home1TNSListener
net start oracleServiceORCL
net start oraclejobschedulerorcl //¿ÉÒÔ½ûÓÃ
¹Ø±Õ£º
net stop oracledbconsoleorcl
net stop oracleOraDb10g_home1iSQL*Plus
net stop oracleOraDb10g_h ......
ÎÊÌâÃèÊö£º
µ±Êý¾Ý¿âµÄ×Ö·û¼¯ÎªÖÐÎÄʱ£¬timestampÀàÐ͵Ä×Ö¶ÎΪÒÔϸñʽ£º
04-3ÔÂ -10 03.57.41.631000 ÏÂÎç
ÎÒÔÚÓÃJDOM½«Êý¾Ýµ¼³öΪXMLʱ£¬timestampÀàÐÍ×ֶεÄÖµ·´ÉúÁ˱仯£¬±ä³ÉÁËһϸñʽ
<CREATE_DATE>2010-3-4.15.57. 30. 505000000</CREATE_DATE>
½â¾ö·½°¸£º
ÔÚ²éѯ¸Ã×Ö¶ÎʱÊ×ÏÈÓÃto_char£¨£©º¯Êý½ ......
1.DUAL±íµÄÓÃ;
Dual ÊÇ OracleÖеÄÒ»¸öʵ¼Ê´æÔÚµÄ±í£¬ÈκÎÓû§¾ù¿É¶ÁÈ¡£¬³£ÓÃÔÚûÓÐÄ¿±ê±íµÄSelectÓï¾ä¿éÖÐ
--²é¿´µ±Ç°Á¬½ÓÓû§
SQL> select user from dual;
USER
------------------------------
SYSTEM
--²é¿´µ±Ç°ÈÕÆÚ¡¢Ê±¼ä
SQL> select sysdate from dual;
SYSDATE
-----------
2007-1-2 ......
¿Í»§·´Ó³³ÌÐòºÜÂý£¬¿ªÊ¼ÒÔΪÊý¾ÝÁ¿´ó£¬ÔÚ±íÖвéѯʹÓõÄ×Ö¶ÎÉÏ£¬Ìí¼ÓÁËË÷Òý£¬Ã»ÓÐÃ÷ÏÔµÄЧ¹û£¬¼ì²éʱ·¢ÏÖÒÔÇ°µÄͬÊÂÔÚsql serverÖÐдµÄº¯ÊýÖÐʹÓÃÁËin£¬¶øÔÚinµÄ½á¹û¼¯ÖлáÓÐ2500Ìõ¼Ç¼×óÓÒ£¬Ö´ÐÐʱ¼äÐèÒª13Ãë¡£ÕÒµ½ÎÊÌâ¸ùÔ´£¬
Ð޸ķ½·¨£º °ÑinºóÃæµÄ×Ó²éѯ×÷Ϊһ¸ö±íºÍÖ÷±í¹ØÁª£¬Ìí¼ÓÏÞÖÆÌõ¼þ¡£
ÔÀ´Ð´·¨£º select * fro ......
²Î¿¼£ºhttp://gaowenjie7758.blog.163.com/blog/static/5946788920091116244306/
SQL´æ´¢¹ý³ÌÖÐSELECTÓëSET ¶Ô±äÁ¿¸³ÖµµÄÇø±ð
SQL Server ÖжÔÒѾ¶¨ÒåµÄ±äÁ¿¸³ÖµµÄ·½Ê½ÓÃÁ½ÖÖ£¬·Ö±ðÊÇ SET ºÍ SELECT¡£¶ÔÓÚÕâÁ½ÖÖ·½Ê½µÄÇø±ð£¬SQL Server Áª»ú´ÔÊéÖÐÒѾÓÐÏêϸµÄ˵Ã÷£¬µ«ºÜ¶àʱºòÎÒÃDz¢Ã»ÓÐ×¢Ò⣬ÆäʵÕâÁ½ÖÖ·½Ê½»¹ÊÇÓкܶ ......