How to select "Group" column name from another table in an SQL Server?

1.4k Views Asked by At

Group is column in one of the table. I am using below query. As Group is reserve keyword, getting error while executing below query:

select o.group as group,
 p.id as id 
from
product p left join org o on p.id=o.id

Could anyone guide?

1

There are 1 best solutions below

0
jarlh On BEST ANSWER

Regular SQL Server way:

select o.[group] as [group],

And SQL Server does also support the ANSI SQL way (perhaps some setting needed?)

select o."group" as "group",