• A.AuthorID A.AuthorName B.BookID B.BookName
  • chap_jadval RIGHT OUTER JOIN o`ng_jadval ON bog`lanish_sharti WHERE o`ng_jadval IS NULL




    Download 1,82 Mb.
    bet16/20
    Sana27.05.2024
    Hajmi1,82 Mb.
    #254618
    1   ...   12   13   14   15   16   17   18   19   20
    Bog'liq
    4-maruza

    chap_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.

    Download 1,82 Mb.
    1   ...   12   13   14   15   16   17   18   19   20




    Download 1,82 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    chap_jadval RIGHT OUTER JOIN o`ng_jadval ON bog`lanish_sharti WHERE o`ng_jadval IS NULL

    Download 1,82 Mb.