
1-1. List the capabilities of SQL SELECT statements 描述一個SQL SELECT 敘述 1-2. Execute a basic SELECT statement 執行一個簡單的SELECT敘述
1-3. Differentiate between SQL statements and iSQL*Plus commands 瞭解SQL與iSQL*Plus命令間的差異
SELECT *|{[DISTINCT] column|expression [alias],...} FROM table;
SQL的語句可以分多行來表示,但關鍵字與變數不可分割斷行.
DISTINCT 過濾重複值
*distinct必頇放置在所有column之前. 當一個欄位時,只傳回唯一值.
當二個欄位以上時,傳回欄位組合的唯一值.
Aslias欄位別名
*在SELECT選取欄位後可接 as 或空白,來替代欄位別名。 SQL > SELECT job 職位 FROM emp; 或
SQL > SELECT job 職位 FROM emp; 或
SQL > SELECT job AS 職位 FROM emp; 兩者結果相同
FROM 表格來源
*在FROM子句中可接表格或用子查詢來替代表格. SQL > SELECT * FROM emp ;
SQL > SELECT * FROM ( SELECT job FROM emp) ;
Arithmetic Expressions 數學表示式 運算優先順序 * / + -
SQL > SELECT 120*salary+100 FROM employees; 要注意salary先乘120再加100 *在使用欄位運算時,欄位值如果是CHAR型態,回傳時會自動轉型為NUMBER SQL > CREATE TABLE b ( b1 CHAR(10) ) ; SQL > INSERT INTO b VALUES (‘2’) ; SQL > SELECT b1 * 2 FROM b ; success!!
SQL > INSERT INTO b VALUES (‘a’) ; SQL > SELECT b1 * 2 FROM b ; false!!
當欄位運算遇到NULL時,則傳回NULL
SQL > SELECT NULL*2 COLUMN1 , 123*2 COLUMN2 FROM dual;
COLUMN1 123*2

246
Concatenation Operator 連結運算元,注意 連接字串時是使用’’單引號,而欄位別名是使用 雙引號 連結運算元 || 用來連接兩個欄位值,其值不分number,char,date型別. SELECT last_name || ' is a ' || job_id AS "Employee Details" FROM employees;
Introduction to Oracle9i SQL -__ Volume III oracle认证教材oracle认证教材隐藏>> Introduction to Oracle9i: SQL Additional Practices ? Volume 3 40049GC10 Produ...
Oracle OCP SQL Introduction to Oracle9i SQL 认证考试 PPT讲义Oracle OCP SQL Introduction to Oracle9i SQL 认证考试 PPT讲义隐藏>> Introduction to Oracle9i: SQL...
Introduction to Oracle9i: SQL Electronic Presentation 40049GC11 Production 1.1 October 2001 D33996 Copyright ? Oracle Corporation, 2001. All rights reserved....
Oracle9i-SQL-20 Oracle9i... 22页 免费 Introduction to Oracle9i... 暂无评价 41页 免费 Introduction to Oracle9i... 76页 5财富值 Oracle OCP SQL Introduct...
Introduction to Access S... 暂无评价 51页 免费 An Introduction to SQL I... 暂无评价 23页 免费 Introduction to Oracle9i... 76页 5财富值 Introduction...
Introduction to Access S... 暂无评价 51页 免费 An Introduction to SQL I... 暂无评价 23页 免费 Introduction to Oracle9i... 76页 5财富值 Introduction...
Exam# 1Z0-007: Introduction to Oracle9i: SQL? Writing Basic SQL Select Statements [ ] List the capabilities of SQL SELECT statements [ ] Execute a bas...
表1-3 Oracle9i Certified Associate 考试概况 考试号 1Z0-007 考试内容 Introduction to Oracle9i:SQL 1Z0-031 Oracle9i Database : Fundamentals I 44 60 73% ...
SQL Group FunctionsSQL Group Functions隐藏>> SQL Group Functions Introduction to Oracle9i: SQL 1 Chapter Objectives ? Differentiate between single-row and mult...
Introduction to Oracle9i: SQL I-5 Oracle9i Database Object Relational Data Documents XML Multimedia Messages I-6 Copyright ? Oracle Corporation, 2001. All ...
热门文档