开发者

How do I run a query on a database whose name contains a space?

开发者 https://www.devze.com 2022-12-19 14:02 出处:网络
In MySQL I created a database with name like de mo, and it cont开发者_高级运维ains a table like tablename. When I try to execute a query, for example:

In MySQL I created a database with name like de mo, and it cont开发者_高级运维ains a table like tablename. When I try to execute a query, for example:

select * from de mo.tablename

I am not able to execute that query. How can I do that?


You'll have to quote the database name:

SELECT * FROM `de mo`.tablename

Spaces in identifiers are best avoided really.


use backticks:

`de mo`


It is necessary to quote the name. Usually backticks are used:

select * from `de mo`.tablename
0

精彩评论

暂无评论...
验证码 换一张
取 消