I am converting my Access and MS SQL databases to MySQL and have a few
problems:
The following works in Access and MS SQL but not MySQL:
SELECT * FROM [CFG] WHERE [Id] = "XXX"
SELECT * FROM [USER] WHERE [Name] = "XXX"
SELECT * FROM [PRODUCT] WHERE [1] = "XXX"
In the last SELECT, the fields are numbered 1 to 10 in the PRODUCT table.
The reason I enclosed all by table names in [ and ] is because USER is a
special name in MS SQL.
The following works in MySQL:
SELECT * FROM CFG WHERE Id = "XXX"
SELECT * FROM 'USER' WHERE Name = "XXX"
But I cannot work around the last one where the field number is a number.
It is possible to configure MySQL so that it can recognise the [ and ]
brackets?
How can I include in the WHERE clause where the field name is a number?
Any help greatly appreciated.
Tks
John
problems:
The following works in Access and MS SQL but not MySQL:
SELECT * FROM [CFG] WHERE [Id] = "XXX"
SELECT * FROM [USER] WHERE [Name] = "XXX"
SELECT * FROM [PRODUCT] WHERE [1] = "XXX"
In the last SELECT, the fields are numbered 1 to 10 in the PRODUCT table.
The reason I enclosed all by table names in [ and ] is because USER is a
special name in MS SQL.
The following works in MySQL:
SELECT * FROM CFG WHERE Id = "XXX"
SELECT * FROM 'USER' WHERE Name = "XXX"
But I cannot work around the last one where the field number is a number.
It is possible to configure MySQL so that it can recognise the [ and ]
brackets?
How can I include in the WHERE clause where the field name is a number?
Any help greatly appreciated.
Tks
John
Comment