{"Entry":{"collection":"func","key":"avg","name":"avg","aliases":[],"metadata":{"changed_in":["7.3","8.4"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":["avg ( expression ) → numeric for any integer type argument, double precision for a floating-point argument, otherwise the same as the argument data type"],"removed":["AVG ( expression )"]},"status":"changed","to":"7.3"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.3","group_changed":null,"signatures":{"added":["avg ( expression ) → numeric for any integer-type argument, double precision for a floating-point argument, otherwise the same as the argument data type"],"removed":["avg ( expression ) → numeric for any integer type argument, double precision for a floating-point argument, otherwise the same as the argument data type"]},"status":"changed","to":"8.4"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"c66f19fe023a150a1276f48c3274956d2de6986ec86b4d863ad0b11d485fb089","derived_content_hash":"2315498a6839436ae62a8966de4a2e1ec619386b6cc0f42f69f213777af62544","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:e9e9d069f064ced7c5dc6e3c29b16d6c17094be9ce6f40aa6ff53fd312a14c59","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"7.1","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate"],"imported_at":"2026-09-27T17:57:28.896817+08:00","last_version":"20","name":"avg","name_key":"avg","position":21002,"present_in":["7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:c59b743e06883476ec9c49bb302253ce79994e3a1dbfd16c32f0a8905065139d","receipt_sha256":"c5d59de793d7ced244cfc9de340ee738e266a4ae42f4d6538e2733a6c3674814","repair":"wiki-repair-20261023"},"signature":"avg ( smallint ) → numeric","signature_count":7,"slug":"avg","source_rev":"wiki-repair-20261023:e9e9d069f064ced7c5dc6e3c29b16d6c17094be9ce6f40aa6ff53fd312a14c59","summary":"Computes the average (arithmetic mean) of all the non-null input values.","summary_zh":""}},"Definition":{"Collection":"func","Key":"avg","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"avg","SourceRevision":"wiki-repair-20261023:e9e9d069f064ced7c5dc6e3c29b16d6c17094be9ce6f40aa6ff53fd312a14c59","Facts":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","doc":{"anchor":"FUNCTIONS-AGGREGATE-TABLE","file":"functions-aggregate.html","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-aggregate.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","version":"18.7"},{"file":"functions-aggregate.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"0bf7506d27b71666fc74840a21a8f77c8a92735174f1d05033865961722e457c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"aggregate","group_label":"聚合函数","lang":"en","layout":"table-new","pages":["functions-aggregate.html"],"prose_only":false,"signatures":[{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003esmallint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( smallint ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( integer ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( bigint ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( numeric ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ereal\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( real ) → double precision","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( double precision ) → double precision","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einterval\u003c/code\u003e","returns":"interval","text":"avg ( interval ) → interval","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-aggregate.html","sha256":"68da7af09e2749a855188bbbff99ae036fc7eece4e19b8e048baffd28aa3ca59"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-AGGREGATE-TABLE","file":"functions-aggregate.html","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"avg","SourceDatabase":"center","Version":"18","Locale":"en","Title":"avg","Summary":"Computes the average (arithmetic mean) of all the non-null input values.","BodyHTML":"Computes the average (arithmetic mean) of all the non-null input values.","SourceRevision":"wiki-repair-20261023:e9e9d069f064ced7c5dc6e3c29b16d6c17094be9ce6f40aa6ff53fd312a14c59","ContentHash":"bfbfd6088a44a2bcebf99054ed4de215a4a06cbe3180e27c4aed5c2479e4385d","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","signatures":[{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003esmallint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( smallint ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( integer ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( bigint ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( numeric ) → numeric","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ereal\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( real ) → double precision","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( double precision ) → double precision","zh_from":"same-version-manual"},{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einterval\u003c/code\u003e","returns":"interval","text":"avg ( interval ) → interval","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"a9eec06d76e6dca9825a2fe5b5753efe755dad0051dbda7ba6e6ad9fabbe0bac","Text":"avg ( smallint ) → numeric","Returns":"numeric","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003esmallint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( smallint ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":1,"Hash":"4c58928615174bdcf6debc0ae2a31e9a0251ee882424f1617c959169faa847f4","Text":"avg ( integer ) → numeric","Returns":"numeric","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einteger\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( integer ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":2,"Hash":"6ee4f3bba01e7200e71637363ce4bee82b97c44d5613a442a5e62a8ff6387bcc","Text":"avg ( bigint ) → numeric","Returns":"numeric","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( bigint ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":3,"Hash":"4fa1cc5ef9a889b027b9b8cd356401e81f2500d5e45d10f619a301260a0ccc54","Text":"avg ( numeric ) → numeric","Returns":"numeric","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"avg ( numeric ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":4,"Hash":"93500ae02e31e84570109a71348ae174ffad1643eec9bf38b20c785d54a69f82","Text":"avg ( real ) → double precision","Returns":"double precision","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003ereal\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( real ) → double precision","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":5,"Hash":"482d8d7a87bf5abc8eeaed67761d78339495e9fa6dbedfea69b7ce1aa803c980","Text":"avg ( double precision ) → double precision","Returns":"double precision","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"avg ( double precision ) → double precision","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":6,"Hash":"d23068d3a11233b4a8e780b8935e8c57ac23454de9251a8f6de856887fc5f9ca","Text":"avg ( interval ) → interval","Returns":"interval","Payload":{"description":"Computes the average (arithmetic mean) of all the non-null input values.","description_html":"Computes the average (arithmetic mean) of all the non-null input values.","description_zh":"计算所有非空输入值的平均值（算术平均值）。","description_zh_html":"计算所有非空输入值的平均值（算术平均值）。","examples":[],"html":"\u003ccode class=\"function\"\u003eavg\u003c/code\u003e ( \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003einterval\u003c/code\u003e","returns":"interval","text":"avg ( interval ) → interval","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
