0

There is some Data in the MySQL Workbench. Column name is Left , Right in one table .

 Select PersonNumber,Left,Right,PhotoNumbr from Person.  

This query is showing is error. How can I fetch these records ,One thing cannot change column name in table.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
Bachas
  • 233
  • 6
  • 16

1 Answers1

2

Escape in square brackets the column names which are coincident with SQL Server functions:

SELECT PersonNumber, [Left], [Right], PhotoNumbr
FROM Person;

For future reference, do not name your columns using keyword or function names.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360