Thaum twg tsis phim los ntawm qhov chaw nws puas rho tawm?
Thaum twg tsis phim los ntawm qhov chaw nws puas rho tawm?

Video: Thaum twg tsis phim los ntawm qhov chaw nws puas rho tawm?

Video: Thaum twg tsis phim los ntawm qhov chaw nws puas rho tawm?
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Kaum ib hlis
Anonim

Peb ua tau siv THAUM TSIS MATCHED NTAWM SOURCE clause hauv SQL Server MERGE nqe lus rau rho tawm cov kab hauv lub hom phiaj lub rooj uas tsis match koom nrog a qhov chaw rooj. Yog li, thaum peb siv THAUM TSIS MATCHED NTAWM SOURCE thiab ua tau los yog rho tawm kab lossis hloov kho nws.

Ntawm no, qhov xav tau ntawm Merge nqe lus yog dab tsi?

Cov MERGE nqe lus yog siv los hloov pauv hauv ib lub rooj raws li qhov muaj nuj nqis sib luag los ntawm anther. Nws tuaj yeem siv los muab ntxig, hloov kho, thiab tshem tawm cov haujlwm ua ib qho nqe lus.

Tsis tas li ntawd, koj yuav rho tawm cov lus sib koom ua ke hauv SQL li cas? Yog koj siv INSERT, UPDATE, thiab DELETE nqe lus tus kheej, koj yuav tsum tsim peb cais nqe lus txhawm rau hloov kho cov ntaub ntawv mus rau lub hom phiaj lub rooj nrog cov kab sib txuam los ntawm lub rooj qhov chaw. THOV DELETE ; Ua ntej, koj qhia lub hom phiaj lub rooj thiab cov lus hauv lub MERGE lus.

Ntawm no, peb tuaj yeem siv Delete hauv Merge nqe lus?

Basic syntax rau lub MERGE nqe lus : DELETE tau tsuas yog tshwm sim hauv "merge_update_clause" ntawm cov schema saum toj no. Qhov no txhais tau hais tias nws yuav tsum tshwm sim nyob rau hauv WHEN MATCHED THEN clause.

Thaum matched ces hloov kho qhov twg?

Thaum MATCHED ces UPDATE SET Yog lub hauv paus rooj koom kem muaj ntau tshaj ib phim tus nqi , MERGE nqe lus rov qab nrog lub sijhawm ua haujlwm yuam kev.

Pom zoo: