{"Entry":{"collection":"func","key":"greatest","name":"GREATEST","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"16"}],"content_hash":"3f884bf526f713c9e91efa9fb9c6ca750125b9f9fd22b93bc66ddd74da28432b","derived_content_hash":"4dab3af254f36d685fdf39e788b3a8627b4f0fed9751c391cbfbde5c528e1c52","first_version":"8.1","group":"conditional","group_label":"Conditional Expressions","groups":["conditional"],"imported_at":"2026-09-27T17:57:28.855363+08:00","last_version":"20","name":"GREATEST","name_key":"greatest","position":18001,"present_in":["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":"b7bd9cda","receipt_sha256":"2d0bfba98ca3fe63b11f2da52920b8caccaef997bfe5906c7f0f65ee2f185967","repair":"wiki-repair-20261023"},"signature":"GREATEST(value [, ...])","signature_count":1,"slug":"greatest","source_rev":"wiki-repair-20261023:ceb44768ee3ebb780e8db402a91610bef67ba12bcf3fd5185363307720616e20","summary":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions.","summary_zh":""}},"Definition":{"Collection":"func","Key":"greatest","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"greatest","SourceRevision":"wiki-repair-20261023:ceb44768ee3ebb780e8db402a91610bef67ba12bcf3fd5185363307720616e20","Facts":{"description":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","description_html":"The \u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e and \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" title=\"10.5. UNION, CASE, and Related Constructs\"\u003eSection 10.5\u003c/a\u003e for details).","description_zh":"GREATEST 和 LEAST 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见第 10.5 节）。","description_zh_html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e 和 \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见\u003ca href=\"/zh/docs/18/typeconv-union-case.html\" title=\"10.5. UNION、CASE及相关结构\"\u003e第 10.5 节\u003c/a\u003e）。","doc":{"anchor":"FUNCTIONS-GREATEST-LEAST","file":"functions-conditional.html","slug":"18"},"group":"conditional","group_label":"Conditional Expressions","lang":"en","layout":"table-new","pages":["functions-conditional.html"],"prose_only":false,"signatures":[{"description":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","description_html":"The \u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e and \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" title=\"10.5. UNION, CASE, and Related Constructs\"\u003eSection 10.5\u003c/a\u003e for details).","description_zh":"GREATEST 和 LEAST 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见第 10.5 节）。","description_zh_html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e 和 \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见\u003ca href=\"/zh/docs/18/typeconv-union-case.html\" title=\"10.5. UNION、CASE及相关结构\"\u003e第 10.5 节\u003c/a\u003e）。","examples":[],"html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e])","returns":"","text":"GREATEST(value [, ...])","zh_from":"same-version-pgdoc"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-conditional.html","sha256":"d64886927461000afd7c15ad2f1983cd4a12f85a8207144d9f72a6668d65132f"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-GREATEST-LEAST","file":"functions-conditional.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"greatest","SourceDatabase":"center","Version":"18","Locale":"en","Title":"GREATEST","Summary":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","BodyHTML":"The \u003ccode\u003eGREATEST\u003c/code\u003e and \u003ccode\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" rel=\"nofollow\"\u003eSection 10.5\u003c/a\u003e for details).","SourceRevision":"wiki-repair-20261023:ceb44768ee3ebb780e8db402a91610bef67ba12bcf3fd5185363307720616e20","ContentHash":"6cb956a30cad67d52e33428e8536a55e94b5d4bb4f8f6ca7c5f3b8533f4e961f","Payload":{"description":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","description_html":"The \u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e and \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" title=\"10.5. UNION, CASE, and Related Constructs\"\u003eSection 10.5\u003c/a\u003e for details).","signatures":[{"description":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","description_html":"The \u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e and \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" title=\"10.5. UNION, CASE, and Related Constructs\"\u003eSection 10.5\u003c/a\u003e for details).","description_zh":"GREATEST 和 LEAST 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见第 10.5 节）。","description_zh_html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e 和 \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见\u003ca href=\"/zh/docs/18/typeconv-union-case.html\" title=\"10.5. UNION、CASE及相关结构\"\u003e第 10.5 节\u003c/a\u003e）。","examples":[],"html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e])","returns":"","text":"GREATEST(value [, ...])","zh_from":"same-version-pgdoc"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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":"b844d513ebdd84e0dd7038ad5c37081a842bfc446e5855f57fe12dc03c757ebb","Text":"GREATEST(value [, ...])","Returns":"","Payload":{"description":"The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).","description_html":"The \u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e and \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see \u003ca href=\"/docs/18/typeconv-union-case.html\" title=\"10.5. UNION, CASE, and Related Constructs\"\u003eSection 10.5\u003c/a\u003e for details).","description_zh":"GREATEST 和 LEAST 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见第 10.5 节）。","description_zh_html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e 和 \u003ccode class=\"function\"\u003eLEAST\u003c/code\u003e 函数从由任意数量的表达式组成的列表中选取最大值或最小值。这些表达式都必须能转换为同一个数据类型，该类型将作为结果类型（详情参见\u003ca href=\"/zh/docs/18/typeconv-union-case.html\" title=\"10.5. UNION、CASE及相关结构\"\u003e第 10.5 节\u003c/a\u003e）。","examples":[],"html":"\u003ccode class=\"function\"\u003eGREATEST\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e [\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e])","returns":"","text":"GREATEST(value [, ...])","zh_from":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
