{"Entry":{"collection":"func","key":"mode","name":"mode","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"302d5217e5319233236b1aa5ac1b6e0a6df18ed08c09639259b8b6f7cb49eb7b","first_version":"9.4","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate"],"imported_at":"2026-09-14T21:49:48.861708+08:00","last_version":"20","name":"mode","name_key":"mode","position":21032,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"mode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement","signature_count":1,"slug":"mode","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Computes the mode, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values).","summary_zh":""}},"Definition":{"Collection":"func","Key":"mode","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"mode","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Computes the mode, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003emode\u003c/em\u003e, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-ORDEREDSET-TABLE","file":"functions-aggregate.html","slug":"18"},"group":"aggregate","group_label":"Aggregate Functions","lang":"en","layout":"table-new","pages":["functions-aggregate.html"],"prose_only":false,"signatures":[{"description":"Computes the mode, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003emode\u003c/em\u003e, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003emode\u003c/code\u003e () \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"mode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ORDEREDSET-TABLE","file":"functions-aggregate.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"mode","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"mode","Summary":"计算众数，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","BodyHTML":"计算\u003cem\u003e众数\u003c/em\u003e，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。\u003cpre\u003emode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement\u003c/pre\u003e计算\u003cem\u003e众数\u003c/em\u003e，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","SourceRevision":"ca936764","ContentHash":"a30eb711b0c7f1ee1833390569c82e9f1aa1aa354be14be84a670966091a0392","Payload":{"description_zh":"计算众数，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","description_zh_html":"计算\u003cem class=\"firstterm\"\u003e众数\u003c/em\u003e，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","signatures":[{"description_zh":"计算众数，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","description_zh_html":"计算\u003cem class=\"firstterm\"\u003e众数\u003c/em\u003e，即聚合参数中出现次数最多的值（若多个值的出现次数相同且最多，则任意选择其中第一个）。聚合参数必须是可排序类型。","returns":"anyelement","text":"mode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"b150907673ebb0fbefdde2341914ccf57dca0d468c554d10392e2e5fa65da0d7","Text":"mode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement","Returns":"anyelement","Payload":{"description":"Computes the mode, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003emode\u003c/em\u003e, the most frequent value of the aggregated argument (arbitrarily choosing the first one if there are multiple equally-frequent values). The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003emode\u003c/code\u003e () \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"mode () WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
