Oacle 기반


 1、set linesize 100;        
  2、set pagesize 30;             
  3、em a.sql           
  4、@ a     a    ,         @d:a.txt  
  5、conn    /                           (sys)     as sysdba;  
  6、show user;            
  7、select * from tab;               
  8、desc temp;        
  9、/               
     clear scr;      
   
       
 10、select upper('coolszy') from dual;           ,dual       
 11、select lower('KUKA') from dual;             
 12、select initcap('kuka') from dual;          
 13、select concat('Hello',' world') from dual;      ,   ||  select concat('Hello','world') from dual;  
 14、select substr('hello',1,3) from dual;        
 15、select length('hello') from dual;         
16、select replace('hello','l','x') from dual;         
 17、select substr('hello',-3,3) from dual;        
   
       
 18、select round(789.536) from dual;     ,      
 19、select round(789.536,2) from dual;         
 20、select round(789.536,-1) from dual;            
 21、select trunc(789.536) from dual;     ,      
 22、select trunc(789.536,2) from dual;  
 23、select trunc(789.536,-2) from dual;  
 24、select mod(10,3) from dual;   10%3     
   
       
 25、select sysdate from dual;         
 26、select months_between(sysdate,'16-6  -08') from dual;          
 27、select add_months(sysdate,4) from dual;           
 28、select next_day(sysdate,'   ') from dual;          
 29、select last_day(sysdate) from dual;           
   
   
       
 30、select to_char(sysdate,'yyyy') year,to_char(sysdate,'mm'),to_char(sysdate,'dd') from dual;  
 31、select to_char(sysdate,'yyyy-mm-dd') from dual;  
 32、select to_char(sysdate,'fmyyyy-mm-dd') from dual;          0  
 33、select to_char('20394','99,999') from dual;     9      
 34、select to_char('2034','L99,999') from dual;         
 35、select to_number('123')*to_number('2') from dual;  
 36、select to_date('1988-07-04','yyyy-mm-dd') from dual;   
   
       
 37、select nvl(null,0) from dual;    null,  0    
 38、select decode(1,1,'   1',2,'   2',3,'   3') from dual;     switch...case...  
   
       
 39、commit;        
 40、rollback;       
   
   
 41、select rownum from table;             
 42、drop table    cascade constraint   
     on delete casecade            ,            
   
 43、desc           
 44、create user [username] identified by [password]         
 45、grant   1、  2...to              
  ex:grant create session to [username]             
     grant connect,resource to [username]            
 46、alter user [username] identified by [password]         
 47、alter user [username] password expired              
 48、alter user [username] account lock        
 49、alter user [username] account unlock         
 50、grant select,delete on scott.emp to [username]  scott emp         
 51、revoke select ,delete on scott.emo from [username]       

좋은 웹페이지 즐겨찾기