Hello Mark and John,

Mark Goodge wrote:
John Furlong wrote:

My question is, can the argument in AGAINST() refer to a column in
another table or does it have to be a specific string you are
searching for? If  the MATCH() function won't work, any suggestions
on how else to compare table1.name against table2.name? The columns
are defined as VARCHAR.

Does anyone have an answer to this? I, too, would like to know how to use fulltext to compare data between two columns (as opposed to comparing data between a column and a pre-defined string). Is there any way to do this?

Mark


The manual answers this question quite clearly. From the page:
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
~~~~
Full-text searching is performed using MATCH() ... AGAINST syntax. MATCH() takes a comma-separated list that names the columns to be searched. AGAINST takes a string to search for, and an optional modifier that indicates what type of search to perform. The search string must be a literal string, not a variable or a column name.
~~~~

Unfortunately, you cannot use the column name directly. However you may be able to construct and execute a search query using the PREPARED STATEMENT commands using the data from your other table.

http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-statements.html

--
Shawn Green, MySQL Senior Support Engineer
Sun Microsystems, Inc.
Office: Blountville, TN



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to