On Saturday 23 April 2005 7:15 pm, steve wrote:
> Assume a database table named Good has a column named "bob".
> The following command will return ALL rows in the table regardless of their
> content:
>
> SELECT * FROM Good WHERE bob LIKE "bob";
>
> Is this by design? If so, is there a workaround for this other than
> attempting to name all columns in a table to be so unique as to never be
> "LIKEd"?
>
More to try....
SELECT * from Good WHERE "bob" like 'bob';
SELECT * from Good WHERE 'bob' like 'bob';
SELECT * from Good WHERE 'bob' like "bob";
See the pattern?
Double quotes are used for column names, single quotes
for values.
Your SELECT * from Good WHERE bob like "bob"; is the
same as saying
SELECT * from Good WHERE 1 = 1;
Scott
--
POPFile, the OpenSource EMail Classifier
http://popfile.sourceforge.net/
Linux 2.6.11.4-20a-default x86_64