select top 10 count(commentName+commentNameIP) as cnt,commentName+commentNameIP as nameIP from comments group by commentName+commentNameIP
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jake Sent: Friday, December 31, 2004 3:49 PM To: [email protected] Subject: Query help I'm dinking around on a day off afternoon, and hit a mental block. I know this shouldn't be this tough... I have a single table for comments on my blog. It has: commentID - unique ID of the entry commentName - name of the person commenting commentEntryIDFK - the FK to the entry ID that this comment belongs to commentNameIP - IP address of the person commenting All I want to do is run and output a query that finds who the top posters are by counting all the same names that also have the same IP. For instance if there are two "Jake" named people, but they have different IPs, they would not be counted as one person. But basically I want to find out who the top 10 commenters are. ------ On another front, in a similar fashion, is there a way to count a text field in the DB to find the largest entries by characters? Thanks! Jake ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
