Cov txheej txheem:

Merge command hauv SQL yog dab tsi?
Merge command hauv SQL yog dab tsi?

Video: Merge command hauv SQL yog dab tsi?

Video: Merge command hauv SQL yog dab tsi?
Video: kheev lam sij hawm tig tau rov qab 10/23/2018 2024, Kaum ib hlis
Anonim

Taw qhia rau lub MERGE Statement thiab SQL ntawv Server Data Modification. 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.

Raws li, kev sib koom ua haujlwm hauv SQL li cas?

Cov MERGE nqe lus hauv paus ua haujlwm raws li cais INSERT, UPDATE, thiab DELETE cov lus tag nrho hauv tib nqe lus. Koj qhia meej tias "Qhov Chaw" cov ntaub ntawv teev tseg thiab "Target" lub rooj thiab kev koom ua ke ntawm ob.

Ib sab saum toj no, DML Merge hais kom ua dab tsi? Qhov no nqe lus yog ib txoj kev yooj yim rau ua ke ntau yam kev ua haujlwm. Nws tso cai rau koj kom tsis txhob muaj ntau yam INSERT, Hloov Kho, thiab DELETE DML cov lus . MERGE yog kev txiav txim siab nqe lus . Qhov ntawd yog , koj tsis tuaj yeem hloov kho tib kab ntawm lub hom phiaj rooj ntau zaus hauv tib yam MERGE nqe lus.

Ib yam li ntawd, tib neeg nug, dab tsi yog kev sib koom ua ke hauv SQL nrog piv txwv?

Cov MERGE nqe lus tso cai rau koj los koom nrog cov ntaub ntawv qhov chaw nrog lub rooj sib tham lossis saib, thiab tom qab ntawd ua ntau yam tawm tsam lub hom phiaj raws li cov txiaj ntsig ntawm qhov kev koom ua ke. Rau piv txwv , koj tuaj yeem siv lub MERGE nqe lus los ua cov haujlwm hauv qab no.

Koj sib sau cov lus nug li cas?

Nov yog cov kauj ruam los ua ke cov rooj no:

  1. Nyem rau ntawm cov ntaub ntawv tab.
  2. Hauv Pawg Tau Txais & Hloov Cov Ntaub Ntawv, nyem rau ntawm 'Get Data'.
  3. Nyob rau hauv lub drop-down, nyem rau ntawm 'Combine Queries.
  4. Nyem rau 'Merge'.
  5. Nyob rau hauv lub Merge dialog box, xaiv 'Merge1' los ntawm tus thawj nco.
  6. Xaiv 'Region' los ntawm qhov thib ob nco.

Pom zoo: