Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Help with formatting
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

SiSL
Average Member

Turkey
671 Posts

Posted - 08 February 2008 :  03:11:32  Show Profile  Visit SiSL's Homepage
Seriously guys my brain stucks sometimes...

Just going to ask such thing, I have a table like that

ID AUTHOR MESSAGE
-------------------
1 25 LALALA
2 25 XXXX
3 30 ZZZ
4 30 YYYY
5 25 TRALALA

As a funny example

I want to pick most active authors from those... like here in this example author with authorid = 25 wrote 3 messages, authorid 30 wrote 2 messages

So I want to have such list like:
1. Author 25
2. Author 30

Which SQL statement I can do that with?

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 08 February 2008 :  04:34:17  Show Profile
Something like:
Select Author, Count(Id) As Messages FROM table_name Group By Author Order By Messages DESC
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 08 February 2008 :  05:07:34  Show Profile  Visit SiSL's Homepage
Thank you so much, going to try that :)

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07