Cov txheej txheem:

Kuv tuaj yeem siv koom nrog cov lus nug hloov tshiab?
Kuv tuaj yeem siv koom nrog cov lus nug hloov tshiab?

Video: Kuv tuaj yeem siv koom nrog cov lus nug hloov tshiab?

Video: Kuv tuaj yeem siv koom nrog cov lus nug hloov tshiab?
Video: Tus Cawm Seej Hloov Neeg Txoj Hmoo (HD) 2024, Kaum ib hlis
Anonim

Rau nug cov ntaub ntawv los ntawm cov rooj sib tham, koj feem ntau siv tus koom clauses, los yog sab hauv koom los yog sab laug koom . Hauv SQL Server, koj siv tau cov no koom clauses hauv UPDATE nqe lus los ua ib tug ntoo khaub lig rooj hloov tshiab . Ua ntej, qhia lub npe ntawm lub rooj (t1) uas koj xav tau hloov tshiab hauv Hloov tshiab lus.

Tsuas yog li ntawd, peb puas tuaj yeem siv koom nrog cov lus nug hloov tshiab?

MySQL Hloov tshiab JOIN syntax Koj feem ntau siv koom rau nug kab los ntawm ib lub rooj uas muaj (nyob rau hauv rooj plaub ntawm INNER Koom ) lossis tej zaum yuav tsis muaj (nyob rau hauv rooj plaub ntawm LEFT Koom ) txuam kab hauv lwm lub rooj. Hauv MySQL, koj siv tau tus Koom clauses hauv UPDATE nqe lus los ua tus ntoo khaub lig rooj hloov tshiab.

Tsis tas li ntawd, peb puas tuaj yeem siv koom nrog cov lus nug hloov tshiab hauv Oracle? Hloov tshiab kab nrog cov nqi ntawm ib lub rooj Koom hauv Oracle . Qhov ntawd koom cov kab ntawm niam txiv UPDATE cov lus nug nrog cov kab los ntawm SELECT subquery.

Ntawm no, kuv yuav ua li cas sab hauv koom nrog cov lus nug hloov tshiab?

Qhov yooj yim tshaj plaws thiab ntau txoj hauv kev yog siv cov lus sib koom hauv cov lus hloov tshiab thiab siv ntau lub rooj hauv cov lus hloov tshiab

  1. Hloov tshiab rooj 1.
  2. SET Col 2 = t2. Col2,
  3. Col 3 = t2. Col3.
  4. Los ntawm table1t1.
  5. INNER JOIN rooj 2 t2 ON t1. Col1 = t2.col1.
  6. t1. Col1 IN (21, 31)

Kuv tuaj yeem hloov kho ob lub rooj hauv ib lo lus nug?

Koj ua tau 't hloov ntau lub rooj hauv ib nqe lus txawm li cas los xij, koj ua tau siv kev lag luam kom paub tseeb tias ob UPDATE cov nqe lus raug kho atomically. Koj ua tau kuj batch lawv kom tsis txhob mus ncig.

Pom zoo: