Re: create view not working

2008-06-18 Thread Martijn Tonies
Aaron, why doesn't this work? the select works perfectly Define doesn't work? What is the error message? create view cost_report as SELECT c_name, d_manuf as Manufacturer, d_model as Model, count(1) as Number Enrolled, d_price as Monthly Price, count(1)*d_price as Cost FROM `b_devices` A

Re: slave is running slow in another data center

2008-06-18 Thread Ananda Kumar
do a show full processlist on the 4th slave and see what process is running. This will the sql's running which will be the cause of the slowness. Also u need to check on the INTERNET bandwidth from the current data center to the other data center. On 6/18/08, Sagar, Sanjeev [EMAIL PROTECTED]

Do I need to use GROUP BY to do this?

2008-06-18 Thread Grant Giddens
Hi, nbsp; I have a table where I keep sales transactions, so I'm trying to do a query that will count the number of transactions per day. My test data looks like: -- -- Table structure for table `sales_activity` -- CREATE TABLE `sales_activity` ( nbsp; `sales_id` int(11) NOT NULL

Re: Do I need to use GROUP BY to do this?

2008-06-18 Thread Sebastian Mendel
Re: Do I need to use GROUP BY to do this? yes Grant Giddens schrieb: Hi, nbsp; I have a table where I keep sales transactions, so I'm trying to do a query that will count the number of transactions per day. My test data looks like: What type of query do I need to get that information?

Re: Do I need to use GROUP BY to do this?

2008-06-18 Thread Ian Simpson
I happen to have worked on a similar query this morning, so it's in my mind :) SELECT SUBSTRING(sales_date,1,10), COUNT(sales_id) FROM sales_activity WHERE sales_type = 1 GROUP BY SUBSTRING(sales_date,1,10); should do the trick. On Tue, 2008-06-17 at 18:21 -0700, Grant Giddens wrote: Hi,

RE: slave is running slow in another data center

2008-06-18 Thread Sagar, Sanjeev
do a show full processlist on the 4th slave and see what process is running. This will the sql's running which will be the cause of the slowness. This does not help because there is not a specific query, which is running slow. Other 3 slaves are running same query and Ive compared the explain

How to guarantee an integrity in this case?

2008-06-18 Thread tmk
I want to do this: [1] read a row from table table_1 with select [2] change a row from [1] with update [3] change another row in table table_1 with update But queries [2] and [3] in the time of invoking, assume that row from query [1] wasn't changed. Should I use LOCK TABLES? - I've tried that

Re: How to guarantee an integrity in this case?

2008-06-18 Thread Martijn Tonies
Hi, I want to do this: [1] read a row from table table_1 with select [2] change a row from [1] with update [3] change another row in table table_1 with update But queries [2] and [3] in the time of invoking, assume that row from query [1] wasn't changed. Should I use LOCK TABLES? - I've