user3206440
user3206440

Reputation: 5049

SQL - referencing a column name with [ , ] characters

I have a table that contains the column name distance[m] - what is the right way to reference this in a SQL query like below

SELECT
  AVG(distance[m]) AS avg_distance
FROM
  distance_table

Upvotes: 0

Views: 40

Answers (1)

user359040
user359040

Reputation:

Try using double quote characters (") - like so:

SELECT
  AVG("distance[m]") AS avg_distance
FROM
  distance_table

Upvotes: 2

Related Questions