user881703
user881703

Reputation: 1199

mysql table name with '@'

One of my database table columns have name like 'name@from'

how can i write select query for get all values for name@from columns

this query gave to me error

 SELECT `name@from` FROM tabName

Upvotes: 1

Views: 279

Answers (2)

nad2000
nad2000

Reputation: 4925

SELECT "name@from" FROM tabName;

will do the trick

Permitted characters in unquoted identifiers:

ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)

However, if the ANSI_QUOTES SQL mode is enabled, it is also permissible to quote identifiers with other characters.

Upvotes: 0

Menztrual
Menztrual

Reputation: 41597

Wrap `` around the column name :)

Upvotes: 1

Related Questions