tags:

views:

51

answers:

3

In MySQL I create a database name like de mo, and it contains 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?

+5  A: 

You'll have to quote the database name:

SELECT * FROM `de mo`.tablename

Spaces in identifiers are best avoided really.

martin clayton
+1 for saying "best avoided"
MarkR
A: 

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

select * from `de mo`.tablename
wallyk
+2  A: 

use backticks:

`de mo`
Tim