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

Re: Percent?

2001-02-15 Thread Atle Veka
couldn't you just do: SELECT data1 * 100 FROM table; which if data1 is 0.25, you'd get a result of 25, and depending on what you're using for the frontend, it would be really easy to add on the percentage sign - Atle On Thu, 15 Feb 2001, John Halladay wrote: I can't find this in the

Re: Percent?

2001-02-15 Thread btjones
SELECT CONCAT(data1*100,'%') as percdata1, data2, data3 FROM table; John Halladay [EMAIL PROTECTED] wrote: I can't find this in the manual (maybe I'm looking in the wrong place). How do I show a value as a percent? For example. SELECT data1, data2, data3 FROM table; Assuming data1 is 0.25,

RE: Percent?

2001-02-15 Thread Oson, Chris M.
]] Sent: Thursday, February 15, 2001 11:27 AM To: John Halladay Cc: MySQL List (E-mail) Subject: Re: Percent? couldn't you just do: SELECT data1 * 100 FROM table; which if data1 is 0.25, you'd get a result of 25, and depending on what you're using for the frontend, it would be really easy to add

RE: Percent?

2001-02-15 Thread John Halladay
: Thursday, February 15, 2001 1:36 PM To: John Halladay Cc: MySQL List (E-mail) Subject: Re: Percent? SELECT CONCAT(data1*100,'%') as percdata1, data2, data3 FROM table; John Halladay [EMAIL PROTECTED] wrote: I can't find this in the manual (maybe I'm looking in the wrong place). How do I show