Adding a subquery

2010-10-22 Thread MikeB
I'm having real difficulty figuring out how to use a subquery in another query. In fact, I'm not even sure if I do need a subquery or if I can accomplish what I want some other way. Running: Server version: 5.1.49-community-log Protocol version: 10 MySQL client version: mysqlnd 5.0.7-dev - 0912

WTA Increasing InnoDB Speed

2010-10-22 Thread Willy Mularto
Dear List, I have MySQL 5.14 installed on Dell R710 32GB RAM 600GB SAS HDD with Ubuntu 10.04 64 Bit. I deploy InnoDB as my default engine. The server is a high load server. On a fresh install and empty table it can insert around 5 millions new records per day average. But when the table getting

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: Alphabetical pagination mysql regexp query problem

2010-10-22 Thread Michael Dykman
Is this what you meant? SELECT * FROM tbl where Fname REGEXP '^[abcd]' AND Lname REGEXP '^[abcd]' (alternatively, the extression could be simpliefied as "REGEXP '^[a-d]" ) - md On Fri, Oct 22, 2010 at 11:01 AM, bharani kumar wrote: > in my database, > > > if i want to render firstname and la

Re: Alphabetical pagination mysql regexp query problem

2010-10-22 Thread bharani kumar
in my database, if i want to render firstname and lastname match case , am using REGEXP '^[abcd]' WORK FOR SINGLE FIELD, Now i have fname and lastname , How to make the query , which display both and single field satisfieds records , That is my query should return like Name(combined Firstnam

RE: harmonic mean in SQL

2010-10-22 Thread Jay Blanchard
[snip] The mathematical way to add two "partial" harmonic means to generate new harmonic mean is: Let X1 , X2 be two harmonic means on different rollup rows, generated using n1 and n2 # of facts respectively. The combined harmonic mean would be: (n1 + n2)/( n1/x1 + n2/x2) If you have experienc

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 mat