Jump to content

GROUP BY particular fields value??


Scooby08

Recommended Posts

If I have a table with info like so:

 

id    user_id    type    status    created_on

1      1            a          pending  2011-02-14 23:26:26

2      1            b          pending  2011-02-14 23:26:26

3      1            c          pending  2011-02-14 23:26:26

4      1            c          pending  2011-02-14 23:26:26

5      1            a          pending  2011-02-14 23:26:26

 

Would there be a way to count the total rows, while making the type 'c' values count as only one row? So really there would be only 4 rows counted here..

 

Is there something similar to the below out there that could work?

 

SELECT * FROM table WHERE status = 'pending' GROUP BY type = 'c'

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/227713-group-by-particular-fields-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.