[thelist] [CFMX] How to implement a search feature?

Chris Johnston chris at fuzzylizard.com
Thu Jun 19 13:40:42 CDT 2003

> Ah, maybe then use
> where (col1+col2 etc) like foo?

Syntactically, this runs, but it does not return the desired results. It
looks like I am stuck doing a series of 'OR' statements.

As for why the other query doesn't work, I found this in the mysql manual:

Note that standard SQL doesn't allow you to refer to an alias in a WHERE
clause. This is because when the WHERE code is executed the column value
may not yet be determined. For example, the following query is illegal:

SELECT id,COUNT(*) AS cnt FROM table_name WHERE cnt > 0 GROUP BY id;

The WHERE statement is executed to determine which rows should be included
in the GROUP BY part while HAVING is used to decide which rows from the
result set should be used.

I learn something everyday.

Thanks for the help, i think I am going to take a look at the fulltext
options in mysql.

Chris Johnston

chris at fuzzylizard.com

More information about the thelist mailing list