Skip to content

Commit 251d1d8

Browse files
github-actions[bot]soyeric128
authored andcommitted
💬Generate LLM translations
1 parent 84d0c5a commit 251d1d8

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

docs/cn/sql-reference/20-sql-functions/05-datetime-functions/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ title: 日期与时间函数
5454
- [DATE_SUB](date-sub)
5555
- [SUBTRACT INTERVAL](subtractinterval.md)
5656
- [MONTHS_BETWEEN](months-between.md)
57+
- [LAST_DAY](last-day.md)
58+
- [NEXT_DAY](next-day.md)
59+
- [PREVIOUS_DAY](previous-day.md)
5760

5861
## 日期信息函数
5962

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: LAST_DAY
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="引入或更新: v1.2.655"/>
8+
9+
根据提供的日期或时间戳,返回指定间隔(周、月、季度或年)的最后一天。
10+
11+
## 语法
12+
13+
```sql
14+
LAST_DAY(<date_expression>, <interval>)
15+
```
16+
17+
| 参数 | 描述 |
18+
|---------------------|---------------------------------------------------------------------------------------------------------------|
19+
| `<date_expression>` | 用于计算指定间隔最后一天的 DATE 或 TIMESTAMP 值。 |
20+
| `<interval>` | 要查找最后一天的间隔类型。接受的值为 `week``month``quarter``year`|
21+
22+
## 返回类型
23+
24+
Date。
25+
26+
## 示例
27+
28+
假设您想根据交易的一个任意日期(例如,2024-11-13)确定账单日期,该日期始终是该月的最后一天:
29+
30+
```sql
31+
SELECT LAST_DAY(to_date('2024-11-13'), month) AS billing_date;
32+
33+
┌──────────────┐
34+
│ billing_date │
35+
├──────────────┤
36+
2024-11-30
37+
└──────────────┘
38+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: NEXT_DAY
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="引入或更新: v1.2.655"/>
8+
9+
返回给定日期或时间戳之后即将到来的指定星期几的日期。
10+
11+
## 语法
12+
13+
```sql
14+
NEXT_DAY(<date_expression>, <target_day>)
15+
```
16+
17+
| 参数 | 描述 |
18+
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19+
| `<date_expression>` | 用于计算指定星期几的下一个日期的 `DATE``TIMESTAMP` 值。 |
20+
| `<target_day>` | 要查找下一个日期的目标星期几。接受的值包括 `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, 和 `sunday`|
21+
22+
## 返回类型
23+
24+
日期。
25+
26+
## 示例
27+
28+
要查找特定日期(如 2024-11-13)之后的下一个星期一:
29+
30+
```sql
31+
SELECT NEXT_DAY(to_date('2024-11-13'), monday) AS next_monday;
32+
33+
┌─────────────┐
34+
│ next_monday │
35+
├─────────────┤
36+
2024-11-18
37+
└─────────────┘
38+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: PREVIOUS_DAY
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="引入或更新: v1.2.655"/>
8+
9+
返回给定日期或时间戳之前最近指定的星期几的日期。
10+
11+
## 语法
12+
13+
```sql
14+
PREVIOUS_DAY(<date_expression>, <target_day>)
15+
```
16+
17+
| 参数 | 描述 |
18+
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19+
| `<date_expression>` | 一个 `DATE``TIMESTAMP` 值,用于计算指定星期几的前一个出现日期。 |
20+
| `<target_day>` | 要查找前一个出现日期的目标星期几。接受的值包括 `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, 和 `sunday`|
21+
22+
## 返回类型
23+
24+
日期。
25+
26+
## 示例
27+
28+
如果您需要查找给定日期(如 2024-11-13)之前的上一个星期五:
29+
30+
```sql
31+
SELECT PREVIOUS_DAY(to_date('2024-11-13'), friday) AS last_friday;
32+
33+
┌─────────────┐
34+
│ last_friday │
35+
├─────────────┤
36+
2024-11-08
37+
└─────────────┘
38+
```

0 commit comments

Comments
 (0)