mysql AVG() fungsi
Hasil terjemahan:
UK ['eɪvɡ] AS ['eɪvɡ]
abbr.purata purata
mysql AVG() fungsisintaks
Fungsi: Fungsi AVG mengembalikan nilai purata lajur berangka. Nilai NULL tidak termasuk dalam pengiraan.
Sintaks: PILIH AVG(nama_lajur) DARI nama_jadual
mysql AVG() fungsicontoh
//计算 "OrderPrice" 字段的平均值 SELECT AVG(OrderPrice) AS OrderAverage FROM Orders; //找到 OrderPrice 值高于 OrderPrice 平均值的客户 SELECT Customer FROM Orders WHERE OrderPrice>(SELECT AVG(OrderPrice) FROM Orders);