MySQL is not supporting single line comments here. What would be the reason?

后端 未结 2 1257
旧时难觅i
旧时难觅i 2021-01-12 14:14

Here is what I am getting when I use single line comment (using --):

ERROR 1064 (42000): You have an error in your SQL syntax

2条回答
  •  清歌不尽
    2021-01-12 14:53

    Your syntax is wrong - read about comment syntax.

    Just add a space after --:

    mysql> select 1; -- test select
    +---+
    | 1 |
    +---+
    | 1 |
    +---+
    1 row in set (0.00 sec)
    

提交回复
热议问题