Hello.

Sorry for the long post. This has been a big problem for me, and I 
hope someone will help...

I have a long standing problem with an MySQL query. 
Or perhaps a couple of sql query problems...

Firstly I have been told I cannot use sum() on a value while using
group by "parm" because it's not accurate. This is obvious as the
result sets are often quite wrong...

However, while attempting to use MIN(), MAX(), SUM() etc.. it will error
saying:

ERROR 1140: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP
columns is illegal if there is no GROUP BY clause

How can I organize data and get accurate sums? It seems the SQL crowd wants
to have it's cake and eat it too on this one :)

Secondly I have duplicate results. I know this to be the case for many
reasons. 
I have manually taken the raw dump (input data file) and manually calculated
all
the results on paper, and when my counts are off, the are *always* to
factors of
the original number. For example if I get a result of 1024 for a certain
count, and the
output result is wrong, it's always some multiple of 1024 such as 2048.

*However* SELECT DISTINCT doesn't SEE the duplicates, as so:

mysql> CREATE TABLE clean_pcf AS SELECT DISTINCT * FROM pcf where release =
curdate()-1;
Query OK, 2438 rows affected (0.11 sec)
Records: 2438  Duplicates: 0  Warnings: 0

mysql>

Any ideas on how I can get rid of the bug wars???????

Regards,

Kelly Black

Linux was very clearly the answer, but what was the question again?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to