List:General Discussion« Previous MessageNext Message »
From:Graeme B. Davis Date:October 18 2000 3:05pm
Subject:Re: What's wrong with my SELECT?
View as plain text  
I think you have to use HAVING puntos > 0 because puntos isn't a column in
the db.

Graeme
----- Original Message -----
From: "Ariel Manzur" <punto@stripped>
To: <mysql@stripped>
Sent: Wednesday, October 18, 2000 12:14 AM
Subject: What's wrong with my SELECT?


> I'm doing a search on a database, and I'm using this SELECT:
>
> SELECT IF(nombre like '%the text%' OR descripcion like '%the text%', 3,
> IF(( nombre LIKE '%the%' AND nombre LIKE '%text%') or ( descripcion LIKE
> '%the%' AND descripcion LIKE '%text%'), 2, IF(( nombre LIKE '%the%' OR
> nombre LIKE '%text%') or ( descripcion LIKE '%the%' OR descripcion LIKE
> '%text%'), 1, 0))) AS puntos, nombre, descripcion, owner, categoria FROM
> areas WHERE puntos > 0 ORDER BY puntos DESC LIMIT 0,15
>
> It searches for "the text", and then every word of the text. And I get
this
> error:
>
> Unknown column 'puntos' in 'where clause'
>
> I looked into the mysql manual for the syntax of SELECT and AS, and I
> didn't find any error.. Can anyone point me to the problem? The version of
> the server is 3.22.32
>
> Thanks.. bye.
>
> Ariel.
>
>
> Ariel Manzur.
> http://www.freeweb.com.ar - http://www.fwa.com.ar
> Freeweb Argentina - Libertad para la informacion.
>
>
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread53611@stripped
>
> To unsubscribe, send a message to:
>     <mysql-unsubscribe-GraemeD=uu.net@stripped>
>
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
>     http://lists.mysql.com/php/unsubscribe.php
>
>

Thread
What's wrong with my SELECT?Ariel Manzur18 Oct
  • Re: What's wrong with my SELECT?Graeme B. Davis18 Oct