explain:
When designing the database, if you use the MySQL keyword as the column name (for example, order is used for sorting), an error will be reported: java.sql.sqlsyntax errorexception: you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER,CREATE_ TIME,MODIFY_ TIME FROM xxx’ at line 1
terms of settlement:
Modify the column name, do not use the keyword as the column name; (recommended)
When querying, use quotation marks (single quotation marks, double quotation marks and back quotation marks) to enclose the column name of its keyword,
If you use mybatis to write SQL, there is no problem. You can use quotation marks to solve it;
If you use mybatis plus, when querying all columns, you need to list all columns, because the corresponding column names containing keywords need to be processed.
Similar Posts:
- SQL Error: 1064, SQLState: 42000 [Three Methods to Solve]
- About BeanShell error invoking BSH method
- [Err] 1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
- Git commit -m ‘Add Readme’ error: pathspec ‘Readme” did not match any file(s) known to git
- In Oracle, an error is reported: ora-00904
- [Solved] Factory method ‘jdbcDialect‘ threw exception; nested exception is org.springframework.data.jdbc.repo
- Error reporting of Python STR type dictionary conversion
- [Solved] json.decoder.JSONDecodeError: Expecting ‘,‘ delimiter: line xx column xx (char xxx)
- How to Solve Mybatis Chinese parameter error
- [Solved] MYSQL Command gruop by Error: this is incompatible with sql_mode=only_full_group_by