This won"t work in MySQL 4.1.10

This won"t work in MySQL 4.1.10

am 27.12.2006 23:37:44 von Peter Karlsson

..... but it runs fine in 4.1.20. In .10 I get an error message about
unknown column c. I built the sql with help from the comments from
the MySQL website manual and have to admit that I don't fully
understand it all ;). Is there a way to solve this without upgrading
the server?


SELECT DISTINCT O.id, O.header, O.state, O.prio, O.publication_date,
O.user_id, MATCH (C.body) AGAINST ('mysearch') AS relevance FROM
texts AS C JOIN jobs AS O ON C.job_id=O.id WHERE O.paper_id = 1 AND
MATCH (c.body) AGAINST('+mysearch' IN BOOLEAN MODE) HAVING relevance
> 0.2 ORDER BY relevance DESC

Best regards,

Peter

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: This won"t work in MySQL 4.1.10

am 04.01.2007 02:22:07 von Chris

Peter Karlsson wrote:
> .... but it runs fine in 4.1.20. In .10 I get an error message about
> unknown column c. I built the sql with help from the comments from the
> MySQL website manual and have to admit that I don't fully understand it
> all ;). Is there a way to solve this without upgrading the server?
>
>
> SELECT DISTINCT O.id, O.header, O.state, O.prio, O.publication_date,
> O.user_id, MATCH (C.body) AGAINST ('mysearch') AS relevance FROM texts
> AS C JOIN jobs AS O ON C.job_id=O.id WHERE O.paper_id = 1 AND MATCH
> (c.body) AGAINST('+mysearch' IN BOOLEAN MODE) HAVING relevance > 0.2
> ORDER BY relevance DESC

You have the cases mixed up (sql is case sensitive in different areas).

You have

FROM texts AS C

then

MATCH(c.body) AGAINST(...)


Try changing the second match against to be C.body instead..

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php