开发者

Blank spaces in column names with MySQL

开发者 https://www.devze.com 2023-03-06 19:05 出处:网络
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

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?


Use backticks.

SELECT * FROM `Area One`
0

精彩评论

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