oracle的case函數下面對ORACLE的CASE函數作一些說明性的案例,當然為了省事,從網上找的案例,再作的功能說明:create sequence STUDENT_SEQUENCE;CREATE TABLE students (id NUMBER(5) PRIMARY KEY,stu_name VARCHAR2(20),score NUMBER(10,0),grade varchar2(2));INSERT INTO students (id, stu_name, score,
在上次基礎上,添加空值判斷:一.直接判斷select case when s1 is null then s1 when s2 is null then s1 when s3 is null then greatest(s1,s2) when s4 is null then greatest(s1,s2,s3) when s5 is null then greatest(s1,s2,s3,s4) when s6 is null then greatest(s1,s2,s3,s4,s5)
Oracle spfile exampleOracle Tips by Burleson ConsultingDon BurlesonFrom: http://www.dba-oracle.com/tips_oracle_spfile_example.htmThe following is from the bestselling book Oracle 10g Grid & Real Application Clusters - Oracle10g Grid Computing
Create Table henry_test (a varchar2(10),b int);Insert Into henry_test values ('aa',1);Insert Into henry_test values ('bb',1);Insert Into henry_test values ('cc',1);Insert Into henry_test values ('dd',2);Insert Into henry_test values ('ee',2);Insert
在OCP 007裡有類似如下的題目: Q: 141 Evaluate this SQL statement:SELECTe.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAMEFROM EMPLOYEES e, DEPARTMENTS dWHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT
本人當寫完這個函數後才知道已經有lengthb()這個現成的函數,無賴對Oracle認識的還是太淺薄,汗自己一個!Oracle下的Length()函數不能區分中英文,只能得到字元數而不能得到位元組數,很多時候插入string到欄位中時總要先進行一次檢查,防止string長度超過了欄位定義的長度,一般大家都是把這個檢測放到應用程式中執行,用我寫的這個小函數就可以實現在資料庫伺服器端對要插入的欄位進行檢測。create or replace function
1.使用 CREATE_BASELINE_TEMPLATE 預存程序建立 single baseline template:col BASELINE_NAME for a30TEMPLATE_NAME for a30select DBID,BASELINE_ID,BASELINE_NAME,BASELINE_TYPE,EXPIRATION,TEMPLATE_NAME from dba_hist_baseline; DBID BASELINE_ID BASELINE_NAME
Windows環境下: C:\Documents and Settings\Administrator>C:\Documents and Settings\Administrator>C:\Documents and Settings\Administrator>exp user/password@oracle tables=table1 rows=y indexes=y compress=y buffer=65536 feedback=100000