MySQL Forums
Forum List  »  Newbie

Re: query works on mysql windows version ,but not on mysql solaris version
Posted by: Jay Pipes
Date: June 17, 2005 08:07AM

You will have to do something like:

CREATE TEMPORARY TABLE tmp_counts (
date DATE NOT NULL
, errcode VARCHAR(25) NOT NULL
, cnt INT NOT NULL
, INDEX (errcode));

INSERT INTO tmp_counts
SELECT date,errcode,count(errcode) cnt from websec
where errcode in ('WIP663','WIP701')
GROUP BY date,errcode;

SELECT errcode, avg(tbl.cnt) from tmp_counts
GROUP BY errcode;

DROP TABLE tmp_counts;

Hope this helps

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.