user718359
user718359

Reputation: 515

Blank spaces in column names with MySQL

One of the column names in my database is two words long, including a blank space, i.e.: Area One. I am using SELECT and referring to the column names to pull the data I want. Now if I name the column _Area_One_, my SELECT works, but if I use _Area One_, it does not. It says Unknown column 'Area' in 'field list'

Ideas?

Upvotes: 7

Views: 20366

Answers (1)

Intrepidd
Intrepidd

Reputation: 20868

Use backticks.

SELECT * FROM `Area One`

Upvotes: 22

Related Questions