Re: Variable for row number?

2010-03-12 Thread Pavel Gulchouck
On Fri, Mar 12, 2010 at 11:37:16PM +0100, Carsten Pedersen writes: CP> Pavel Gulchouck skrev: >> Is there any way to get sequence row number in request? >> I need row number calculated before "having" but after "group by" >> and "order", so "select @row := @row+1" unsuitable in my case >> (it exec

Re: Variable for row number?

2010-03-12 Thread Carsten Pedersen
Pavel Gulchouck skrev: Hi! Is there any way to get sequence row number in request? I need row number calculated before "having" but after "group by" and "order", so "select @row := @row+1" unsuitable in my case (it executed before grouping). something along the lines of this: mysql> select *

Re: Nested inserts possible?

2010-03-12 Thread Johan De Meersman
Have a look at last_insert_id() . On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark wrote: > I have two tables and I have data to insert into both at the same time, > but the second table depends on an ID that

RE: Nested inserts possible?

2010-03-12 Thread Gavin Towey
If you're inserting multiple rows in the dependent table for the same id in the parent table, you'll need to save the value of LAST_INSERT_ID(), otherwise subsequent inserts will change it! INSERT INTO parent VALUES (...); SET @id:=LAST_INSERT_ID(); INSERT INTO child1 VALUES (@id, ... ); INSERT

Re: Nested inserts possible?

2010-03-12 Thread Keith Clark
Johan, That seems to be the ticket. Thanks! Keith On Fri, 2010-03-12 at 16:54 +0100, Johan De Meersman wrote: > Have a look at last_insert_id(). > > On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark > wrote: > I have two tables and I have data to insert into both at the > same time

Re: Nested inserts possible?

2010-03-12 Thread mos
Keith, You will need to reference the mysql_insert_id() function after adding the row to Table_One. Then use the value returned for the rest of the tables. http://dev.mysql.com/doc/refman/5.1/en/getting-unique-id.html Mike At 08:48 AM 3/12/2010, you wrote: I have two tables and I have

Re: mysql proxy in production?

2010-03-12 Thread Johan De Meersman
On Fri, Mar 12, 2010 at 3:05 PM, Krishna Chandra Prajapati < prajapat...@gmail.com> wrote: > The below link shows the benchmark between different web servers ( apache, > niginx, cherokee). > Irrelevant to this list, but I'll bite: there is no detail whatsoever on the configuration of the various

Nested inserts possible?

2010-03-12 Thread Keith Clark
I have two tables and I have data to insert into both at the same time, but the second table depends on an ID that is auto created in the first table. I'm not sure exactly how to accomplish this. Table_One Table_One_Index_ID Data_One Date_Two Table_Two Table_Two_Index_ID Table_One_Index_ID Dat

Re: mysql proxy in production?

2010-03-12 Thread Krishna Chandra Prajapati
Hi all, The below link shows the benchmark between different web servers ( apache, niginx, cherokee). http://lists.octality.com/pipermail/cherokee/2009-May/010343.html *http://nerdbynature.de/benchmarks/ab/2009-05-16/* Conclusion of Above Benchmarks *It seems that Cherokee continues being the f

Re: mysql proxy in production?

2010-03-12 Thread Johan De Meersman
On Thu, Mar 11, 2010 at 4:49 PM, Brent Clark wrote: > On 11/03/2010 16:52, Krishna Chandra Prajapati wrote: > >> Hi Brent >> >> You can visit the below link. >> >> >> http://www.mysqlperformanceblog.com/2009/06/09/mysql-proxy-urgh-performance-and-scalability/ >> > > Well thats disappointing. > > s

Variable for row number?

2010-03-12 Thread Pavel Gulchouck
Hi! Is there any way to get sequence row number in request? I need row number calculated before "having" but after "group by" and "order", so "select @row := @row+1" unsuitable in my case (it executed before grouping). -- Pavel -- MySQL General Mailing List For list archives: http://lists.mys

Re: mysql proxy in production?

2010-03-12 Thread Krishna Chandra Prajapati
Hi Walter, I have tried and tested haproxy (ver 1.3). But it doesn't work to my expectation. May be newer version (1.4) works better. Brent try and check http://sqlrelay.sourceforge.net/sqlrelay/ http://www.cherokee-project.com/ http://www.alobbs.com/1344/MySQL_asynchronous_balancing_with_HTTP_