homepage Welcome to WebmasterWorld Guest from 54.234.231.49
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library : Charter : Moderators: physics & whoisgregg

Databases Forum

    
Count multiple secondary children values as one
CodilX




msg:4259423
 1:24 pm on Jan 28, 2011 (gmt 0)

Hi there,

I have this db:


id domain page clicks
1 domain1.com /about_us 11
2 domain1.com /contact 22
3 domain2.com /about_us 33
3 domain2.com /some_page 44
..

Is it possible to do an automated query, without any PHP usage, to count all page clicks, but refer it to as the parent domain name?

The output that I'm trying to achieve:

domain1.com 33
domain2.com 77

Thanks ;)

 

coopster




msg:4259605
 5:58 pm on Jan 28, 2011 (gmt 0)

SELECT domain, SUM(clicks) AS totalClicks FROM table GROUP BY domain

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved