Forums
This topic is locked
(my)SQL question
Posted 15 Aug 2001 21:29:48
1
has voted
15 Aug 2001 21:29:48 Mark Labordus posted:
This is what I have:SELECT ROUND((TO_DAYS(NOW())-TO_DAYS(birthdate))/365) as age, if(gender = 'M', COUNT(*), 0) as male, if (gender = 'F', COUNT(*), 0) as female
FROM users
GROUP BY age, gender
This is the result:
age, male, female
20 , 12 , 0
21 , 0 , 3
24 , 8 , 0
24 , 0 , 6
What I want is that the last two results are shown together, I mean like this:
24, 8, 6
DOes anyone know how to do this?
Replies
Replied 15 Aug 2001 23:40:22
15 Aug 2001 23:40:22 Joel Martinez replied:
Question Answered on the Dreamweaver Ultradev Forum.
PS. Please try to avoid crossposting <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
PS. Please try to avoid crossposting <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
Replied 15 Aug 2001 23:45:54
15 Aug 2001 23:45:54 Mark Labordus replied:
Sorry about that.. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>