Well, I know how to count the number of rows a query returns, but Im looking for something a little more in depth and I can't figure it out, nor do I know exactly what to serach for.
Here is what I'm trying to do, I hope somebody has done this before, or can help.
Say I have a bunch of rows in a table, these are news posts by many users. I want to do a query that says how many posts each user has.
My table looks like,
ID | Username | Date | Data
1 | Bob | Today | Testing
2 | Bob | Today | Testing
3 | Bob | Today | Testing
4 | Bob | Today | Testing
5 | Bob | Today | Testing
6 | Tom | Today | Testing
7 | Tom | Today | Testing
8 | Tom | Today | Testing
Thats fake of course, but that is a good example. I want to say: Bob has 5 posts and Tom has 3. I can use a count of rows but that will return 8, and there are more users then those 2 and names cannot be hardcoded in, so a WHERE username= wont work.
I hope somebody can help, thanks for looking! :-)
Count rows sort of problem
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users