Skip to content

04-functions-and-grouping: Contains errors #1

Description

@chernbo

The content in 04-current-date.sql under 04-functions-and-grouping will report an error.

INSERT INTO test
VALUES(CURRENT_DATE() + 1, NULL, NULL);

When a date is converted to the numeric format 20260531 and incremented by 1, it becomes 20260532, which is not a valid date and causes an error.

Image

Recommended Fixes (DATE_ADD / DATE_SUB ):

INSERT INTO test
VALUES(DATE_ADD(CURRENT_DATE(), INTERVAL 1 DAY), NULL, NULL);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions