Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
43
Добавлен:
18.03.2015
Размер:
684.09 Кб
Скачать

Data Manipulation Language (DML)

3.If the RETURNING clause is present, then the statement is described as isc_info_sql_stmt_exec_ procedure by the API; otherwise, it is described as isc_info_sql_stmt_insert.

Note

A “multiple rows in singleton select” error will be raised if the RETURNING clause is present and more than one record matches the search condition.

New JOIN Types

Adriano dos Santos Fernandes

(v.2.1) Two new JOIN types are introduced: the NAMED COLUMNS join and its close relative, the NATURAL join.

Syntax and Rules

<named columns join> ::=

<table reference> <join type> JOIN <table reference> USING ( <column list> )

<natural join> ::=

<table reference> NATURAL <join type> JOIN <table primary>

Named columns join

1.All columns specified in <column list> should exist in the tables at both sides.

2.An equi-join (<left table>.<column> = <right table>.<column>) is automatically created for all columns (ANDed).

3.The USING columns can be accessed without qualifiers—in this case, the result is equivalent to COALESCE(<left table>.<column>, <right table>.<column>).

4.In “SELECT *”, USING columns are expanded once, using the above rule.

Natural join

1.A “named columns join” is automatically created with all columns common to the left and right tables.

2.If there is no common column, a CROSS JOIN is created.

Examples

/* 1 */

select * from employee join department using (dept_no);

/* 2 */

47

Соседние файлы в папке doc