MySQL Forums
Forum List  »  General

How to use "WHERE expr" in mysql?
Posted by: aaron chan
Date: January 16, 2017 04:04AM

I found "show databases" and "show character set" both support the "WHERE expr".but something differs slightly and very strange.
1)mysql> show character set where Description='DEC West European';
+---------+-------------------+-------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+-------------------+-------------------+--------+
| dec8 | DEC West European | dec8_swedish_ci | 1 |
+---------+-------------------+-------------------+--------+
1 row in set (0.00 sec)
2)mysql> show databases where Database='mysql';
ERROR 1064 (42000): 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 '='mysql'' at line 1

why the first one can use the "Description" column in the where expr but the second one can not?

Options: ReplyQuote


Subject
Written By
Posted
How to use "WHERE expr" in mysql?
January 16, 2017 04:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.