Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc]date func #1856

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[doc]date func #1856

wants to merge 2 commits into from

Conversation

yuanyuan8983
Copy link
Contributor

@yuanyuan8983 yuanyuan8983 commented Jan 17, 2025

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built


Convert the date to the nearest rounding up time of the specified time interval period.
`DATE_CEIL(DATETIME datetime, INTERVAL period type)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 参数不需要类型
  2. 参数需要用尖括号包裹
Suggested change
`DATE_CEIL(DATETIME datetime, INTERVAL period type)`
`DATE_CEIL(<datetime>, INTERVAL <period> <type>)`


mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 year);
```
```sql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block 之间最好加个空行,防止渲染错误

| -- | -- |
| `unit` | The unit to extract from the DATETIME. Possible values are year, month, day, hour, minute, second, or microsecond |
| `from` | Fixed syntax |
| `period` | The argument is a valid date expression |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数中没有 period

| Parameter | Description |
| -- | -- |
| `unit` | The unit to extract from the DATETIME. Possible values are year, month, day, hour, minute, second, or microsecond |
| `from` | Fixed syntax |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

固定的token不用当做参数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants