SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 30th, 1999, 07:54 PM
vdschoor
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I want to get the following result on a webpage :

Date Name type1 type2 type3
1999/11/10 joe 10 2 6

But my in my table they are stored like this :

1999/11/10 joe type1
1999/11/10 joe type2
1999/11/10 joe type1
1999/11/10 joe type3
1999/11/10 joe type1

Can anyone help me with the right query?
I know in MS Access you can do this with :
count(IIF(type=type1),1,0)

Is there a function like this for MySQL?

Reply With Quote
  #2  
Old December 3rd, 1999, 07:55 PM
vdschoor
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I found it myself (finally)
The way to go is :

Select date,count(IF(type='Normal',1,0))..
. group by date;

Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Special Count


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway