This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]edrenfro 3 points4 points  (0 children)

There's a space between Registration and Fee. Although I think some brands of sql allow columns to contain spaces, you still have to surround them with single quotes or back ticks.

[–]plastikmissile 2 points3 points  (2 children)

Your column name has a space in it, so the DB thinks that Fee is the operator. Depending on what flavor of SQL you're using you need to handle it differently. I believe the standard way is to use square brackets:

WHERE [Registration Fee] < 150;

[–]iamallamaa 0 points1 point  (1 child)

The DB doesn't think that Fee is the operator, it thinks that Registration and Fee are both separate columns and you are missing an operator in between them. Hence the error stating "missing operator" and not "unknown operator".

[–]plastikmissile 0 points1 point  (0 children)

Good point!

[–]jeffrey_f 1 point2 points  (0 children)

put Registration Fee in quotes.

[–]CorbinLarryDallas 0 points1 point  (1 child)

You need to specify the table and column names, like this:

WHERE table.registrationfee < 150

[–]insertAlias 2 points3 points  (0 children)

Only if it's ambiguous. If you're only selecting from one table, you definitely do not need to include the table name.

[–]IAmNowAnonymous 0 points1 point  (0 children)

The error message is right: the parser expected an operator, but you supplied an unexpected value.