5.15Aggregate Functions in SQLAggregate functions are those functions  การแปล - 5.15Aggregate Functions in SQLAggregate functions are those functions  ไทย วิธีการพูด

5.15Aggregate Functions in SQLAggre

5.15
Aggregate Functions in SQL
Aggregate functions are those functions that operate on sets of values. Typical
examples include: sum, avg, max, min, and count.
The first four functions operate on “columns” of tables and ignore null values.
The count returns the number of elements of the set that is its argument.
Example 5.15.1 The following select construct determines the largest grade
obtained by the student whose student number is 1011. The function max is
applied to the set of grades of the student whose number is 1011 and returns
the largest value in this set:
select max(grade) as highgr from GRADES
where stno = ’1011’;
This returns the table:
HIGHGR
------
90
For instance, sum(A) returns the sum of all values of the selected nonnull
A-components of the tuples. Similarly, avg(A) returns the average value of the
same sequence. The expressions max(A) and min(A) yield the largest and the
smallest values in the set of A-components of the tuples selected by a query,
respectively.
The functions sum and avg apply to attributes whose domains are numerical
(such as integer or float); max and min apply to every kind of attribute.
If we wish to discard duplicate values from the sequences of values before
applying these functions, we need to use the word distinct. For instance,
sum(distinct A) considers only the distinct nonnull values that occur in the
sequence of components.
Example 5.15.2 We mentioned that the built-in functions max and min apply
to string domains as well as to numerical domains. We use this feature of these
functions to determine the first and the last student in alphabetical order:

0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
5.15Aggregate Functions in SQLAggregate functions are those functions that operate on sets of values. Typicalexamples include: sum, avg, max, min, and count. The first four functions operate on “columns” of tables and ignore null values.The count returns the number of elements of the set that is its argument.Example 5.15.1 The following select construct determines the largest gradeobtained by the student whose student number is 1011. The function max isapplied to the set of grades of the student whose number is 1011 and returnsthe largest value in this set:select max(grade) as highgr from GRADES where stno = ’1011’;This returns the table:HIGHGR------90 For instance, sum(A) returns the sum of all values of the selected nonnullA-components of the tuples. Similarly, avg(A) returns the average value of thesame sequence. The expressions max(A) and min(A) yield the largest and thesmallest values in the set of A-components of the tuples selected by a query,respectively. The functions sum and avg apply to attributes whose domains are numerical(such as integer or float); max and min apply to every kind of attribute. If we wish to discard duplicate values from the sequences of values beforeapplying these functions, we need to use the word distinct. For instance,sum(distinct A) considers only the distinct nonnull values that occur in thesequence of components.Example 5.15.2 We mentioned that the built-in functions max and min applyto string domains as well as to numerical domains. We use this feature of thesefunctions to determine the first and the last student in alphabetical order:
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
5.15
รวมฟังก์ชั่นใน SQL
ฟังก์ชั่นรวมฟังก์ชั่นที่ใช้งานบนชุดของค่า โดยทั่วไป
ตัวอย่างรวมถึง: ผลรวมเฉลี่ยสูงสุด, นาที, และนับ.
ฟังก์ชั่นสายแรกสี่ทำงานใน "คอลัมน์" ของตารางและไม่สนใจค่า null.
นับส่งกลับจำนวนขององค์ประกอบของชุดที่เป็นอาร์กิวเมนต์.
ตัวอย่าง 5.15.1 ต่อไปนี้สร้างเลือกกำหนดเกรดที่ใหญ่ที่สุด
ที่ได้รับจากนักศึกษาที่มีจำนวนนักเรียนสูงสุด 1011 ฟังก์ชั่นจะ
นำไปใช้กับชุดของเกรดของนักเรียนที่มีจำนวนเป็น 1011 และส่งกลับ
ค่าที่มากที่สุดในชุดนี้:
เลือกสูงสุด (เกรด) ในขณะที่ highgr จากการเรียน
ที่ stno = '1011';
นี้จะส่งกลับตาราง:
HIGHGR
------
90
ตัวอย่างเช่นผลรวม () ผลตอบแทนรวมของค่าทั้งหมดที่เลือก nonnull
ส่วนประกอบของ tuples ในทำนองเดียวกันโดยเฉลี่ย () ส่งกลับค่าเฉลี่ยของ
ลำดับเดียวกัน การแสดงออกสูงสุด (A) และต่ำสุด (A) ผลผลิตที่ใหญ่ที่สุดและ
ค่าที่เล็กที่สุดในชุดของส่วนประกอบของ tuples เลือกโดยแบบสอบถาม
ตามลำดับ.
ผลรวมฟังก์ชั่นและโดยเฉลี่ยใช้กับคุณลักษณะที่มีโดเมนที่เป็นตัวเลข
(เช่น จำนวนเต็มหรือข้าวโอ๊ต FL); สูงสุดและต่ำสุดนำไปใช้กับชนิดของแอตทริบิวต์ทุก.
ถ้าเราต้องการที่จะยกเลิกค่าที่ซ้ำกันจากลำดับของค่าก่อนที่จะ
ใช้ฟังก์ชั่นเหล่านี้เราต้องใช้คำที่แตกต่างกัน ยกตัวอย่างเช่น
ผลรวม (ที่แตกต่างกัน) จะพิจารณาเฉพาะค่า nonnull แตกต่างที่เกิดขึ้นใน
ลำดับขององค์ประกอบ.
ตัวอย่าง 5.15.2 เรากล่าวว่าฟังก์ชั่นในตัวสูงสุดและต่ำสุดใช้
กับโดเมนสตริงเช่นเดียวกับโดเมนที่เป็นตัวเลข เราใช้คุณลักษณะเหล่านี้
ฟังก์ชั่นเพื่อตรวจสอบสายแรกและนักเรียนที่ผ่านมาตามลำดับตัวอักษร:

การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
การทำงานในหน้าที่รวมรวม -

คือฟังก์ชัน SQL ที่ใช้งานบนชุดของค่า ตัวอย่างทั่วไป
รวม : ผลรวม , ค่าเฉลี่ย , Max , Min , และนับ
จึงตัดสินใจเดินทางสี่ฟังก์ชันการใช้งานใน " คอลัมน์ " ของตารางและละเว้นค่า null .
นับส่งกลับจำนวนขององค์ประกอบของชุดที่เป็นอาร์กิวเมนต์ .
ตัวอย่าง 5.15.1 ต่อไปนี้เลือกสร้างเป็นตัว
เกรดที่ใหญ่ที่สุดที่ได้จากนักเรียน ซึ่งนักเรียนจำนวนเป็นคุณ . ฟังก์ชัน Max
ใช้กับชุดของผลการเรียนของนักเรียนที่มีหมายเลขและส่งกลับค่า

เลือกใหญ่ที่สุดในชุดนี้ แม็กซ์ ( เกรด ) เป็น highgr จากเกรด
ที่ stno = ' การ์ตูน ' ;
นี้กลับโต๊ะ :

------

highgr 90 รวม ( เช่น A ) จะได้ผลรวมของค่าทั้งหมดของเลือก nonnull
a-components ของทูเปิล .ในทำนองเดียวกัน , AVG ( ) จะคืนค่ากลับมาเป็นค่าเฉลี่ยของ
ลำดับเดียวกัน การแสดงออกสูงสุด ( ) และ มิน ( ) ผลตอบแทนที่ใหญ่ที่สุดและเล็กที่สุดค่า
a-components ในชุดของที่มีจำนวนการค้นหา

ตามลำดับ ฟังก์ชันผลรวมและ AVG ใช้แอตทริบิวต์ที่มีโดเมนมีตัวเลข
( เช่น จำนวนเต็ม หรือflโอ๊ต ) ; max และ min ใช้กับทุก ชนิดของแอตทริบิวต์ .
ถ้าเราต้องการยกเลิกค่าซ้ำจากลำดับของค่าก่อน
ใช้ฟังก์ชันเหล่านี้ เราต้องใช้คำที่แตกต่างกัน ตัวอย่างเช่น
ผลรวม ( แตกต่างกัน ) จะพิจารณาเฉพาะแตกต่างกัน nonnull ค่าที่เกิดขึ้นใน

5.15.2 ลำดับขององค์ประกอบ เช่น เรากล่าวว่าฟังก์ชันในตัว max และ min ใช้
สตริงโดเมนรวมทั้งข้อมูลเชิงตัวเลขเราใช้คุณสมบัติของฟังก์ชันเหล่านี้
หาจึงตัดสินใจเดินทางและนักเรียนคนสุดท้ายตามลำดับอักษร :

การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2026 I Love Translation. All reserved.

E-mail: