Re: Percent of match in condition

2010-10-22 Thread Johan De Meersman
Hmm. You might be able to hack this up using the if() function, but it's not gonna be a beauty to look at, and possibly not terribly performant, either. You may need to look at external data query tools - I think a number of fulltext search tools provide match percentages in their results. On

Re: Percent of match in condition

2010-10-22 Thread Shawn Green (MySQL)
On 10/21/2010 9:57 AM, Ali A.F.N wrote: Hi All, I have a table with different fileds and almost the type of all them are smallint. I want to search on some fields with OR condition. I want to know is there possibility to know how many fileds matched exactly? then I can say how many percent

RE: Percent of match in condition

2010-10-22 Thread Travis Ard
Maybe you could do something like the following with user variables (or prepared statements): set @sex = 1, @country = 120, @education = 0; select if(sex_id = @sex, 1, 0) + if(country_id = @country, 1, 0) + if(education_id = @education, 1, 0) as num_matches, sex_id, country_id, education_id from