{"Entry":{"collection":"func","key":"extract","name":"extract","aliases":[],"metadata":{"changed_in":["8.1","14","19"],"changes":[{"descriptions_changed":true,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"7.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"7.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"7.4"},{"descriptions_changed":true,"doc_overhaul":false,"from":"7.4","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"8.0"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":["EXTRACT(field FROM source)"],"removed":["EXTRACT (field FROM source)"]},"status":"changed","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":false,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":["extract ( field from timestamp ) → numeric","extract ( field from interval ) → numeric"],"removed":["extract ( field from timestamp ) → double precision","extract ( field from interval ) → double precision"]},"status":"changed","to":"14"},{"descriptions_changed":false,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":["extract ( field FROM timestamp ) → numeric","extract ( field FROM interval ) → numeric"],"removed":["extract ( field from timestamp ) → numeric","extract ( field from interval ) → numeric"]},"status":"changed","to":"19"}],"content_hash":"f7c78ce01d641bd3c5e567936d89295b8b43f8fbb55183bce89b2c89a118c5c5","derived_content_hash":"f3c3fb9876690d037fb4258ded2cb414ba4b0a6ffe4f8915af86e1830600280e","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:724b8b2cb077f6056ce13920192ecf1455f2d77cf4f497e810fc2bfb0fc1ce00","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"7.1","group":"datetime","group_label":"Date/Time Functions And Operators","groups":["datetime"],"imported_at":"2026-09-27T17:57:28.53405+08:00","last_version":"20","name":"extract","name_key":"extract","position":8010,"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:5c267618e28ff4e90b8936a3ffd6ee9563bc2ae2b8bed709d1c270c69949c641","receipt_sha256":"081ce54fc14b630134eed99d55affe26ea4fcbf7c8cc9225054bc3321068c77c","repair":"wiki-repair-20261023"},"signature":"extract ( field FROM timestamp ) → numeric","signature_count":3,"slug":"extract","source_rev":"wiki-repair-20261023:724b8b2cb077f6056ce13920192ecf1455f2d77cf4f497e810fc2bfb0fc1ce00","summary":"Get timestamp subfield; see Section 9.9.1","summary_zh":""}},"Definition":{"Collection":"func","Key":"extract","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"extract","SourceRevision":"wiki-repair-20261023:724b8b2cb077f6056ce13920192ecf1455f2d77cf4f497e810fc2bfb0fc1ce00","Facts":{"description":"Get timestamp subfield; see Section 9.9.1","description_html":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间戳子字段；参见第 9.9.1 节","description_zh_html":"获取时间戳子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","version":"18.7"},{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"c3efdd1c3df6795c73dfea2ecec17ca31ff37da23d758083a581d75445851f0c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"datetime","group_label":"时间/日期函数和操作符","lang":"en","layout":"table-new","pages":["functions-datetime.html"],"prose_only":false,"signatures":[{"description":"Get timestamp subfield; see Section 9.9.1","description_html":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间戳子字段；参见第 9.9.1 节","description_zh_html":"获取时间戳子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(hour from timestamp '2001-02-16 20:38:40')","result":"20"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from timestamp ) → numeric","zh_from":"same-version-manual"},{"description":"Get interval subfield; see Section 9.9.1","description_html":"Get interval subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间间隔子字段；参见第 9.9.1 节","description_zh_html":"获取时间间隔子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(month from interval '2 years 3 months')","result":"3"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from interval ) → numeric","zh_from":"same-version-manual"},{"description":"The extract function retrieves subfields such as year or hour from date/time values. source must be a value expression of type timestamp, date, time, or interval. (Timestamps and times can be with or without time zone.) field is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a date, while fields of a day or more cannot be extracted from a time. The extract function returns values of type numeric.","description_html":"The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function retrieves subfields such as year or hour from date/time values. \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e must be a value expression of type \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e, \u003ccode class=\"type\"\u003edate\u003c/code\u003e, \u003ccode class=\"type\"\u003etime\u003c/code\u003e, or \u003ccode class=\"type\"\u003einterval\u003c/code\u003e. (Timestamps and times can be with or without time zone.) \u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a \u003ccode class=\"type\"\u003edate\u003c/code\u003e, while fields of a day or more cannot be extracted from a \u003ccode class=\"type\"\u003etime\u003c/code\u003e. The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function returns values of type \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e.","description_zh":"extract 函数从日期/时间值中检索子字段，例如年份或小时。source 必须是 timestamp、date、time 或 interval 类型的值表达式。（时间戳和时间可以带有或不带有时区。）field 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 date 中提取小于一天的字段，而无法从 time 中提取一天或更长时间的字段。extract 函数返回 numeric 类型的值。","description_zh_html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数从日期/时间值中检索子字段，例如年份或小时。\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e 必须是 \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e、\u003ccode class=\"type\"\u003edate\u003c/code\u003e、\u003ccode class=\"type\"\u003etime\u003c/code\u003e 或 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 类型的值表达式。（时间戳和时间可以带有或不带有时区。）\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 \u003ccode class=\"type\"\u003edate\u003c/code\u003e 中提取小于一天的字段，而无法从 \u003ccode class=\"type\"\u003etime\u003c/code\u003e 中提取一天或更长时间的字段。\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数返回 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e 类型的值。","examples":[],"html":"\u003ccode class=\"function\"\u003eEXTRACT\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e FROM \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e)","returns":"","text":"EXTRACT(field FROM source)","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-datetime.html","sha256":"2340eed8f18e5a5a727bb6bf8f828eedbab527da91082a214ea4f64a3b8750a6"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"extract","SourceDatabase":"center","Version":"18","Locale":"en","Title":"extract","Summary":"Get timestamp subfield; see Section 9.9.1","BodyHTML":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" rel=\"nofollow\"\u003eSection 9.9.1\u003c/a\u003e","SourceRevision":"wiki-repair-20261023:724b8b2cb077f6056ce13920192ecf1455f2d77cf4f497e810fc2bfb0fc1ce00","ContentHash":"e912705b2057b1c77f72471dd3c95cba28f5131133ef605bd619d3457bede40b","Payload":{"description":"Get timestamp subfield; see Section 9.9.1","description_html":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","signatures":[{"description":"Get timestamp subfield; see Section 9.9.1","description_html":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间戳子字段；参见第 9.9.1 节","description_zh_html":"获取时间戳子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(hour from timestamp '2001-02-16 20:38:40')","result":"20"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from timestamp ) → numeric","zh_from":"same-version-manual"},{"description":"Get interval subfield; see Section 9.9.1","description_html":"Get interval subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间间隔子字段；参见第 9.9.1 节","description_zh_html":"获取时间间隔子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(month from interval '2 years 3 months')","result":"3"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from interval ) → numeric","zh_from":"same-version-manual"},{"description":"The extract function retrieves subfields such as year or hour from date/time values. source must be a value expression of type timestamp, date, time, or interval. (Timestamps and times can be with or without time zone.) field is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a date, while fields of a day or more cannot be extracted from a time. The extract function returns values of type numeric.","description_html":"The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function retrieves subfields such as year or hour from date/time values. \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e must be a value expression of type \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e, \u003ccode class=\"type\"\u003edate\u003c/code\u003e, \u003ccode class=\"type\"\u003etime\u003c/code\u003e, or \u003ccode class=\"type\"\u003einterval\u003c/code\u003e. (Timestamps and times can be with or without time zone.) \u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a \u003ccode class=\"type\"\u003edate\u003c/code\u003e, while fields of a day or more cannot be extracted from a \u003ccode class=\"type\"\u003etime\u003c/code\u003e. The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function returns values of type \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e.","description_zh":"extract 函数从日期/时间值中检索子字段，例如年份或小时。source 必须是 timestamp、date、time 或 interval 类型的值表达式。（时间戳和时间可以带有或不带有时区。）field 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 date 中提取小于一天的字段，而无法从 time 中提取一天或更长时间的字段。extract 函数返回 numeric 类型的值。","description_zh_html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数从日期/时间值中检索子字段，例如年份或小时。\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e 必须是 \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e、\u003ccode class=\"type\"\u003edate\u003c/code\u003e、\u003ccode class=\"type\"\u003etime\u003c/code\u003e 或 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 类型的值表达式。（时间戳和时间可以带有或不带有时区。）\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 \u003ccode class=\"type\"\u003edate\u003c/code\u003e 中提取小于一天的字段，而无法从 \u003ccode class=\"type\"\u003etime\u003c/code\u003e 中提取一天或更长时间的字段。\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数返回 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e 类型的值。","examples":[],"html":"\u003ccode class=\"function\"\u003eEXTRACT\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e FROM \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e)","returns":"","text":"EXTRACT(field FROM source)","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":"9e8589368075858f66f7f192396dbdd3b80b46462b365e87ace20a5ac32ca9b3","Text":"extract ( field from timestamp ) → numeric","Returns":"numeric","Payload":{"description":"Get timestamp subfield; see Section 9.9.1","description_html":"Get timestamp subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间戳子字段；参见第 9.9.1 节","description_zh_html":"获取时间戳子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(hour from timestamp '2001-02-16 20:38:40')","result":"20"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from timestamp ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":1,"Hash":"b547624599d55bbf0d5d03b16aa177ff0d5441fb8fd5ea24b8863b01f44ef440","Text":"extract ( field from interval ) → numeric","Returns":"numeric","Payload":{"description":"Get interval subfield; see Section 9.9.1","description_html":"Get interval subfield; see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003eSection 9.9.1\u003c/a\u003e","description_zh":"获取时间间隔子字段；参见第 9.9.1 节","description_zh_html":"获取时间间隔子字段；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\" title=\"9.9.1. EXTRACT, date_part\"\u003e第 9.9.1 节\u003c/a\u003e","examples":[{"expr":"extract(month from interval '2 years 3 months')","result":"3"}],"html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"literal\"\u003efrom\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003enumeric\u003c/code\u003e","returns":"numeric","text":"extract ( field from interval ) → numeric","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":2,"Hash":"d0f92961d39b88994fadf568e9ee8290e748036537e56d506830635f93f97adc","Text":"EXTRACT(field FROM source)","Returns":"","Payload":{"description":"The extract function retrieves subfields such as year or hour from date/time values. source must be a value expression of type timestamp, date, time, or interval. (Timestamps and times can be with or without time zone.) field is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a date, while fields of a day or more cannot be extracted from a time. The extract function returns values of type numeric.","description_html":"The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function retrieves subfields such as year or hour from date/time values. \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e must be a value expression of type \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e, \u003ccode class=\"type\"\u003edate\u003c/code\u003e, \u003ccode class=\"type\"\u003etime\u003c/code\u003e, or \u003ccode class=\"type\"\u003einterval\u003c/code\u003e. (Timestamps and times can be with or without time zone.) \u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e is an identifier or string that selects what field to extract from the source value. Not all fields are valid for every input data type; for example, fields smaller than a day cannot be extracted from a \u003ccode class=\"type\"\u003edate\u003c/code\u003e, while fields of a day or more cannot be extracted from a \u003ccode class=\"type\"\u003etime\u003c/code\u003e. The \u003ccode class=\"function\"\u003eextract\u003c/code\u003e function returns values of type \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e.","description_zh":"extract 函数从日期/时间值中检索子字段，例如年份或小时。source 必须是 timestamp、date、time 或 interval 类型的值表达式。（时间戳和时间可以带有或不带有时区。）field 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 date 中提取小于一天的字段，而无法从 time 中提取一天或更长时间的字段。extract 函数返回 numeric 类型的值。","description_zh_html":"\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数从日期/时间值中检索子字段，例如年份或小时。\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e 必须是 \u003ccode class=\"type\"\u003etimestamp\u003c/code\u003e、\u003ccode class=\"type\"\u003edate\u003c/code\u003e、\u003ccode class=\"type\"\u003etime\u003c/code\u003e 或 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 类型的值表达式。（时间戳和时间可以带有或不带有时区。）\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e 是一个标识符或字符串，用于选择从源值中提取哪个字段。并非每种输入数据类型都适用于所有字段；例如，无法从 \u003ccode class=\"type\"\u003edate\u003c/code\u003e 中提取小于一天的字段，而无法从 \u003ccode class=\"type\"\u003etime\u003c/code\u003e 中提取一天或更长时间的字段。\u003ccode class=\"function\"\u003eextract\u003c/code\u003e 函数返回 \u003ccode class=\"type\"\u003enumeric\u003c/code\u003e 类型的值。","examples":[],"html":"\u003ccode class=\"function\"\u003eEXTRACT\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003efield\u003c/code\u003e\u003c/em\u003e FROM \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e)","returns":"","text":"EXTRACT(field FROM source)","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
