|
chap_jadval RIGHT OUTER JOIN o`ng_jadval ON bog`lanish_sharti WHERE o`ng_jadval IS NULL
|
bet | 16/20 | Sana | 27.05.2024 | Hajmi | 1,82 Mb. | | #254618 |
Bog'liq 4-maruzachap_jadval RIGHT OUTER JOIN o`ng_jadval ON bog`lanish_sharti WHERE o`ng_jadval IS NULL
Misol:
SELECT * FROM Authors A
RIGHT OUTER JOIN Books B ON A.AuthorID = B.BookID
WHERE A.AuthorID IS NULL
FULL JOIN – chap va o`ng tomon jadvallarining barcha qatori qaytariladi. Agar bog`lanish sharti chap va o`ng tomon jadvallarni qanoatlantirsa, ular bir qatorga birlashtiriladi. Bog`lanish sharti qanoatlantirilmasa, NULL qiymati bog`liq bo`lmagan qatorlarga ko`ra chap yoki o`ng tomon jadvallari o`rniga qo`yiladi
chap_jadval FULL OUTER JOIN o`ng_jadval ON bog`lanish_sharti
FULL JOIN sintaksisi:
SELECT maydon nomlari [,... n] FROM Jadval_1
FULL OUTER JOIN Jadval _2 ON bog`liqlik_sharti
Misol:
SELECT * FROM Authors A
FULL OUTER JOIN Books B ON A.AuthorID = B.BookID
Natija
A.AuthorID
|
A.AuthorName
|
B.BookID
|
B.BookName
|
1
|
Bruce Eckel
|
1
|
Thinking in Java
|
2
|
Robert Lafore
|
NULL
|
NULL
|
3
|
Andrew Tanenbaum
|
3
|
Modern Operating System
|
3
|
Andrew Tanenbaum
|
3
|
Computer Architecture
|
NULL
|
NULL
|
4
|
Programming in Scala
|
FULL JOIN orqali chap va o`ng tomondagi jadvallar birlashtirilishi va ularda mos qo`yilgan atributlar orasidagi shart bajarilgandan tashqari (teskari) yozuvlarini chiqarish mumkin.
|
| |