Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- mysql 권한부여
- db 백업
- alter 명령어
- 데이터 갱신
- 컴파일 설치
- 컴파일러 입문
- mysql 계정삭제
- 리눅스
- db 덤프
- vim 자동정렬
- alter 문법
- vim 정렬
- x윈도우
- mysql alter
- mysql 계정생성
- linux log
- 로그 삭제
- db덤프
- 데이터베이스 갱신
- mysql 갱신
- 자동정렬
- 렉스
- 렉스 컴파일
- x-window
- 리눅스 로그 삭제
- 리눅스 gui
- lex 컴파일
- mysql update
- 리눅스 로그
- lex compiler
Archives
- Today
- Total
It's under your control.
OCP license.E03.130626 본문
*UNION Operator
* UNION ALL Operator
* INTERSECT Operator
* MINUS Operator
SQL> select * from a;
ID
----------
1
2
3
SQL> select * from b;
ID
----------
3
4
5
SQL> select id from a
union all
select id from b;
ID
----------
1
2
3
3
4
5
SQL> select id from a
unionselect id from b;
ID
----------
1
2
3
4
5
SQL> select id from a
----------
1
2
3
4
5
SQL> select id from a
intersectselect id from b;
ID
----------
3
SQL> select id from a
----------
3
SQL> select id from a
minusselect id from b;
ID
----------
1
2
SQL> select id from b
----------
1
2
SQL> select id from b
minusselect id from a;
Set Operator Guidelines
• The expressions in the SELECT lists must match in number and data type.
• Parentheses can be used to alter the sequence of execution.
• The ORDER BY clause:
– Can appear only at the very end of the statement
– Will accept the column name, aliases from the first SELECT statement, or the positional notation
• The expressions in the SELECT lists must match in number and data type.
• Parentheses can be used to alter the sequence of execution.
• The ORDER BY clause:
– Can appear only at the very end of the statement
– Will accept the column name, aliases from the first SELECT statement, or the positional notation
The Oracle Server and Set Operators
• Duplicate rows are automatically eliminated except in UNION ALL.
• Column names from the first query appear in the result.
• The output is sorted in ascending order by default except in UNION ALL.
• Duplicate rows are automatically eliminated except in UNION ALL.
• Column names from the first query appear in the result.
• The output is sorted in ascending order by default except in UNION ALL.
The iSQL*Plus COLUMN Command
You can use the iSQL*Plus COLUMN command to customize column headings.
Syntax:
COL[UMN] [{column|alias} [option]]
Where OPTION is:
You can use the iSQL*Plus COLUMN command to customize column headings.
Syntax:
COL[UMN] [{column|alias} [option]]
Where OPTION is:
CLE[AR]: Clears any column formats
HEA[DING] text: Sets the column heading
FOR[MAT] format: Changes the display of the column using a format model
NOPRINT | PRINT: Suppresses or displays the column heading and data
NULL
The following statement suppresses the column data and title heading for the column named
A_DUMMY. Notice that the first SELECT clause in the previous slide creates a dummy column
named A_DUMMY.
COLUMN a_dummy NOPRINT
A_DUMMY. Notice that the first SELECT clause in the previous slide creates a dummy column
named A_DUMMY.
COLUMN a_dummy NOPRINT
• DataBases Objects
object | Dscription |
Table | Basic unit of storage; composed of rows |
View | Logically represents subsets of data from one or more tables |
Sequence | Generates numeric values |
Index | Improves the performance of some queries |
Sysnonym | gives alternative names to objects |
Including Constraints
• Constraints enforce rules at the table level.
• Constraints prevent the deletion of a table if there are dependencies.
• The following constraint types are valid:
– NOT NULL
– UNIQUE
– PRIMARY KEY
– FOREIGN KEY
– CHECK
• Constraints enforce rules at the table level.
• Constraints prevent the deletion of a table if there are dependencies.
• The following constraint types are valid:
– NOT NULL
– UNIQUE
– PRIMARY KEY
– FOREIGN KEY
– CHECK
'Works > OCP' 카테고리의 다른 글
OCP license.E05.130628 (0) | 2013.07.06 |
---|---|
OCP license.E04.130627 (0) | 2013.07.06 |
OCP license.E02.130625 (0) | 2013.07.06 |
OCP license.E01.130624 (0) | 2013.07.06 |
oracle TRUNCATE (0) | 2013.06.26 |