How to Select a Column Name With a Space in MySQL

How to select a column name with a space in MySQL

Generally the first step is to not do that in the first place, but if this is already done, then you need to resort to properly quoting your column names:

SELECT `Business Name` FROM annoying_table

Usually these sorts of things are created by people who have used something like Microsoft Access and always use a GUI to do their thing.

How to specify a Column name (in a where clause) which has a space in MySql

If this is valid, you would have to use backticks:

`Last Name` 

but if you ask me, don't do this. It's begging for trouble somewhere along the way. Just use an underscore or CamelCase: LastName

mysql order by column name with space

Try enclosing them in back-ticks like

ORDER BY `Full Name` ASC

HTH

How to create a column name with space in SQL Server

Use brackets in SQL-Server

create table space_check
(
[roll num] int,
name varchar(50)
)


Related Topics



Leave a reply



Submit