Although, it'll never work, I've to tried below INSERT statement anyway.
INSERT INTO mytable (id, and) VALUES (1, 'TEST');By running above INSERT statement, you will received below error message.
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 'and) VALUES (1,'TEST')' at line 1Some references I got from the Internet, they said it could be solved just by enclosing the column name with quotes ('and'). I've tried and it doesn't work.
Then I've came across MySQL Online Reference, where it stated there are three ways or syntax you could use to refer to a column, which are as below:
- <column_name>
- <table_name>.<column_name>
- <database_name>.<table_name>.<column_name>
INSERT INTO mytable (id, mytable.and) VALUES (1, 'TEST');So by appending the table name prior to the column name (separated by dot '.'), we have turned this statement into a valid INSERT statement. Walla.
1 comment:
beside that method you can do sth like this: [and] and will work too :)
Post a Comment