Cov txheej txheem:

Koj xam qhov nruab nrab hauv database li cas?
Koj xam qhov nruab nrab hauv database li cas?

Video: Koj xam qhov nruab nrab hauv database li cas?

Video: Koj xam qhov nruab nrab hauv database li cas?
Video: Ob zaj dab neeg By Nquab Tsab New Song 2023 2024, Kaum ib hlis
Anonim

Hauv qab scenes, lub AVG function xam cov nruab nrab ntawm qhov tseem ceeb los ntawm kev faib tag nrho cov txiaj ntsig no los ntawm tus lej ntawm qhov tseem ceeb tshwj tsis yog rau NULL qhov tseem ceeb. Yog li ntawd, yog tias tag nrho ntawm cov nqi no tshaj qhov siab tshaj plaws ntawm cov ntaub ntawv hom ntawm qhov tshwm sim, qhov database server yuav muab qhov yuam kev.

Kuj paub, koj pom qhov nruab nrab hauv cov ntaub ntawv li cas?

Hauv qab qhov xwm txheej, AVG muaj nuj nqi suav cov nruab nrab ntawm qhov tseem ceeb los ntawm kev faib tag nrho cov txiaj ntsig no los ntawm tus lej ntawm qhov tseem ceeb tshwj tsis yog rau NULL qhov tseem ceeb. Yog li ntawd, yog tias tag nrho ntawm cov nqi no tshaj qhov siab tshaj plaws ntawm cov ntaub ntawv hom ntawm qhov tshwm sim, qhov database server yuav muab qhov yuam kev.

Ib qho tseem yuav nug, AVG muaj nuj nqi hauv SQL yog dab tsi? SQL ntawv Server AVG () muaj nuj nqi yog aggregate muaj nuj nqi uas rov qab nruab nrab tus nqi ntawm ib pawg. TXHUA tus qhia cov AVG () muaj nuj nqi coj tag nrho cov nqi rau kev xam. TAG NRHO yog siv los ntawm lub neej ntawd. DISTINCT qhia cov AVG () muaj nuj nqi ua haujlwm tsuas yog ntawm cov txiaj ntsig tshwj xeeb.

Ib yam li ntawd, nws tau nug, koj ua li cas xam qhov nruab nrab hauv SQL?

SQL SELECT COUNT, SUM, AVG

  1. SELECT COUNT rov qab suav tus lej ntawm cov ntaub ntawv muaj nuj nqis.
  2. SELECT SUM xa cov lej ntawm cov ntaub ntawv muaj nuj nqis.
  3. SELECT AVG rov qab qhov nruab nrab ntawm cov ntaub ntawv muaj nqis.

Koj xam qhov nruab nrab hauv Microsoft Access li cas?

Ob-nias lub teb koj xav siv thiab nyem rau ntawm "Tag nrho" icon. Tom ntej no mus rau "Tag nrho:" nyob rau hauv lub rooj ceev nyob rau hauv qab ntawm koj lub computer screen xaiv " Avg "to nruab nrab thaj teb.

Pom zoo: