Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: Range INTERVAL 建表语句报语法错误
Could someone please help me understand why using the interval syntax to create a range partitioned table results in an error?
Creating the table in the usual way works, but using the interval method results in the following error:
You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 8 column 9 near “”
You didn’t add a space in “INTERVAL (10) FIRST PARTITION,” right?
Make it clear, the INTERVAL (10) FIRST in line 8 is all marked in red, not separated, and cannot be recognized.
Spaces don’t seem to affect it, the result is the same when executed again.
The execution results are the same after separating.
The same error also occurred.
Is it because the version is not compatible and requires v6.3.0?
What is the TiDB version?
Which version of TiDB are you using?
To use the INTERVAL
syntax for RANGE COLUMNS
partitioning, you can only specify one column as the partition key, and the type of that column must be an integer (INTEGER
), date (DATE
), or datetime (DATETIME
).
This is just a simple range partition. Creating a table using the normal form works fine, but using the interval form results in an error.
Did you directly copy his? Does it report an error?
Didn’t add a space, right?
Thank you, master. The command line execution is indeed fine, but there is an error in DataGrip. It’s very strange.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.