Hi!
It's my variant. Try to use it.
select sex, age, count(*)
...
group by sex, age
Dmitri Lubinski
-----Original Message-----
From: Daren Cotter [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 11:38 PM
To: [EMAIL PROTECTED]
Subject: Dinstinct query
I have two fields, sex, and age, which are both ENUM types. I'm building
some statistical reports, using stuff like:
DISTINCT(sex) ... GROUP BY sex ...
and
DISTINCT(age) ... GROUP BY age ...
Now I want a report that shows me a breakdown by both categories, sex
and
age...so I can see not just how many m/f and 16-18 yr-olds, 19-24
yr-olds,
etc, but how many of each sex in each age group. I've tried:
DISTINCT(sex, age) ... GROUP BY sex, age
But that doesn't work. Can someone help me out? Can I do this in one
Query?
TIA,
Daren Cotter
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php