woolyg Posted September 14, 2007 Share Posted September 14, 2007 Hi, I'm starting to look into a basic search on a table: SELECT field1, field2, field3, DISTINCT MATCH(field1, field2, field3) AGAINST ('keyword' IN BOOLEAN MODE) as score FROM table WHERE MATCH(field1, field2, field3) AGAINST ('keyword' IN BOOLEAN MODE) order by score DESC ..but if I enter more than one word in the keyword bit, some results are replicated (ie, return 2 rows of exactly the same info, but different scores). Is there a way to only return unique rows per result set? Any help appreciated. Woolyg. Quote Link to comment Share on other sites More sharing options...
gerkintrigg Posted September 14, 2007 Share Posted September 14, 2007 why not do SELECT DISTINCT id, blah blah blah.... that should work if you do it on the primary key LIMIT 1 will work for only one record, but not unique rows. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 15, 2007 Share Posted September 15, 2007 Don't know what you mean about unique rows... if you're only using a single table, a row can never be returned twice. Quote Link to comment Share on other sites More sharing options...
woolyg Posted September 17, 2007 Author Share Posted September 17, 2007 OK - thanks for the info! - woolyg. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.