You want each user with a match to show up once, regardless how many art items match, right? How about

SELECT * from users INNER JOIN art ON (users.user_id = art.user_id)
WHERE MATCH (nickname, name_first, name_last, name_middle, city,
state, zip_area, country, bio_short, bio_desc) AGAINST ('kansas')
OR MATCH (title, medium, commentary) AGAINST ('kansas')
GROUP BY users.user_id;

Michael

Ladd J. Epp wrote:

I just tried SELECT DISTINCT and still the same problem -- returning all entries for a matching user_id in art for each user where the word 'kansas' is specified... any other thoughts? Thanks, lje

On Saturday 03 January 2004 16:58, you wrote:

Hi Ladd,

How about SELECT DISTINCT?


Hope that helps.



Matt



----- Original Message ----- From: "Ladd J. Epp" Sent: Saturday, January 03, 2004 11:39 AM Subject: FULLTEXT across two tables


Hello,

I would like to do a FULLTEXT search across two tables. I run an

artist



website, so I need to search across the user list and the users'

associated



art pieces list. I've come up with this query (fulltext indexes for

these



precise values have been created on both tables):

SELECT * from users INNER JOIN art ON (users.user_id = art.user_id)
WHERE MATCH (nickname, name_first, name_last, name_middle, city,

state,



zip_area, country, bio_short, bio_desc) AGAINST ('kansas')
OR MATCH (title, medium, commentary) AGAINST ('kansas');

This query is very close to what I need, except that it returns

redundant



rows. For example, if users.state='kansas' it returns every record

from art



where users.user_id=art.user_id. How do I return records that have

'kansas'



in either users, or art, or both, only once? I think a UNION might

help me



here, but my provider uses MySQL v.3.22 so that is not an option...

I apologize if I am not being clear about something ... If you need

more



detail I would be happy to provide it.





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to