What does the ( ' > ) symbol mean in the comma

2019-02-20 00:42发布

问题:

I'm new to sql and for some reason, the arrow symbol ( -> ) that I am used to seeing in teh command line, which mean it is ready for input, is now displayed as ( '> ) and it does not accept commands. What does it mean and how do I get back to ( -> ) ?

Thanks

回答1:

It means that it is treating any input which follows as part of a string literal, until it encounters a(n unescaped) string termination quote ' character.

This will have happened because you previously began the string literal with such a string termination quote character. For example:

mysql> SELECT foo
    -> FROM   tbl
    -> WHERE  bar LIKE 'somestring
    '> this is still part of somestring'
    -> ;


回答2:

It means you have an incomplete query. Most likely it's something related to a missing quotation, semi-colon at the end, or parentheses aren't closed.