Cov txheej txheem:

Kuv yuav siv li cas ntawm MySQL?
Kuv yuav siv li cas ntawm MySQL?

Video: Kuv yuav siv li cas ntawm MySQL?

Video: Kuv yuav siv li cas ntawm MySQL?
Video: Cas Tsis Xaiv Koj - R-Lin Thoj New Song Original By Zaj Dub [Official MV] 2023 2024, Kaum ib hlis
Anonim

Cov MYSQL BETWEEN xwm txheej qhia txog yuav ua li cas thiaj li tau txais txiaj ntsig los ntawm kev qhia hauv ib qho tshwj xeeb. Nws yog siv nrog SELECT, INSERT, UPDATE thiab DELETE nqe lus.

Ua cov lus nug hauv qab no:

  1. SELECT *
  2. Los ntawm cov neeg ua haujlwm.
  3. THAUM ua haujlwm_date NTAU CAST ('2015-01-24' AS DATE) THIAB CAST ('2015-01-25' AS DATE);

Yog li ntawd, puas MySQL nruab nrab suav nrog?

Cov MySQL BETWEEN Cov xwm txheej yuav xa rov qab cov ntaub ntawv uas qhia nyob rau hauv thaj tsam ntawm tus nqi 1 thiab tus nqi 2 (suav nrog). Thaum siv lub MySQL BETWEEN Cov xwm txheej nrog cov hnub, nco ntsoov siv CAST muaj nuj nqi los hloov cov txiaj ntsig rau hnub.

Ib yam li ntawd, koj ua li cas sau Ib Qhov Nruab Nrab nqe lus hauv SQL? SQL ntawm Syntax SELECT Kem (s) NTAWM table_name NTAWM KAM NTAU tus nqi1 THIAB tus nqi2; Siv cov lus hais saum toj no syntax , peb tuaj yeem txhais cov nqi raws li ib feem ntawm BETWEEN tus neeg teb xov tooj . Tsis tas li ntawd, cov syntax hais los saum toj no tseem zoo ib yam rau kev siv nrog tus lej lej, tus nqi ntawv, thiab hnub tus nqi.

Ib yam li ntawd, nws yog nug, vim li cas ntawm tus neeg teb xov tooj siv?

Cov BETWEEN tus neeg teb xov tooj yog ib qho laj thawj tus neeg ua haujlwm uas tso cai rau koj los txheeb xyuas seb tus nqi hauv qhov ntau lossis tsis. Cov BETWEEN tus neeg teb xov tooj feem ntau yog siv nyob rau hauv QHOV CHAW UA HAUJ LWM ntawm SELECT, UPDATE, thiab DELETE cov lus. Yog hais tias ib qho kev nthuav qhia yog NULL, lub BETWEEN tus neeg teb xov tooj rov NULL.

Yuav siv sab hauv koom nrog MySQL li cas?

MySQL INner JOIN

  1. Ua ntej, qhia cov lus tseem ceeb uas tshwm hauv NTAWM kab lus (t1).
  2. Qhov thib ob, qhia lub rooj uas yuav koom nrog lub rooj tseem ceeb, uas tshwm hauv INNER JOIN clause (t2, t3, …).
  3. Thib peb, qhia txog kev koom nrog tom qab ON lo lus tseem ceeb ntawm INNER JOIN clause.

Pom zoo: