標籤:expdp:SQL> create directory dir_tables as ‘/home/oracle/tables‘;SQL> grant read,write on directory dir_tables to 使用者名稱;expdp system/system密碼@SID tables=使用者名稱.表名 directory=dir_tables dumpfile=tables.dmp logfile=tables.log
標籤:實現目前時間,周,月,季度,半年,年的轉換,其中特別注意的是周的處理,IW方式處理邏輯,如果本周有大於等於4天,本周屬於幾年,如果小於4天,本周屬於下一年以1990/12/31為例,這天屬於199101周SELECT TO_NUMBER(TO_CHAR(SYSDATE, ‘YYYYMMDD‘)) AS PERIOD, SYSDATE AS
標籤:/* * * 複製oracle表中任意一行,並改變相應的數列 * /declarecursor dept_cursor is select * from SCENE_PIC WHERE PICID=‘63563908576556815641‘;beginfor dept_rs in dept_cursorloopdept_rs.PICID:=‘63563908576556815642‘;exit when dept_cursor%notFound;dept_rs.PICID:=null;
標籤:select case when r = 1 then (select s.COMMENTS from user_tab_comments s where Table_Name= aa.table_name) else ‘‘ end as table_comments, case when r = 1 then aa.table_name else ‘‘ end as table_name, aa.r as column_sequence, aa.COLUMN_NAME, aa.
標籤:--1.字元函數--UPPER(string|column) 可以將字元轉成大寫select upper(‘helloword‘) from dual;select upper(ename) from emp;--LOWER(string|column) 將指定的字串轉換成小寫select lower(‘HELLOWORD‘) from dual;select lower(ename) from emp;--INITCAP(string|column) 將單詞的第一個字母大寫select
標籤:前言之所以去糾那麼細節的問題,是因為之前有過一個這樣的情境:有個同學,給了一條資料庫的語句給我,問,為啥這樣子的語句在oracle語句下執行不了。select * from xx where xxx is not null group by yy; 拿到這條語句的第一時間,其實,我也並沒有看出是什麼錯。仔細一想之後才想起,在基礎的SQL中包含該group by的select語句,select語句部分是有限制的,一般是彙總函式和group by