vindaloo
07-10-2003, 09:20 AM
Hi,
I'm getting an error with a SELECT statement that I don't understand.
I have a table called prices where the first 2 fields are called group and type, which are character fields.
This statement does not work:
SELECT * FROM prices WHERE group = 'p'
This statement works:
SELECT * FROM prices WHERE type = 'C150'
This statement also works (the difference from the first example being that group is enclosed in ``)
SELECT * FROM prices WHERE `group` = 'p'
Can anyone explain this? The PHP tutorial I'm following does not use the quotes around the field name in the WHERE clause. I've been using SQL for years (under SAP R/3 ABAP) and have never come across this before.
I'm sure it's a simple error but it's been driving me mad!!!
Many thanks in advance,
Vindaloo.
I'm getting an error with a SELECT statement that I don't understand.
I have a table called prices where the first 2 fields are called group and type, which are character fields.
This statement does not work:
SELECT * FROM prices WHERE group = 'p'
This statement works:
SELECT * FROM prices WHERE type = 'C150'
This statement also works (the difference from the first example being that group is enclosed in ``)
SELECT * FROM prices WHERE `group` = 'p'
Can anyone explain this? The PHP tutorial I'm following does not use the quotes around the field name in the WHERE clause. I've been using SQL for years (under SAP R/3 ABAP) and have never come across this before.
I'm sure it's a simple error but it's been driving me mad!!!
Many thanks in advance,
Vindaloo.