# Complex Site-Stats Query

**URL:** <https://forum.kirupa.com/t/complex-site-stats-query/270450>\
**Category:** programming\
**Created:** [September 10, 2008, 4:53am UTC](https://forum.kirupa.com/t/complex-site-stats-query/270450 "2008-09-10T04:53:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prc](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@prc](https://forum.kirupa.com/u/prc)\
**Post date:** [September 10, 2008, 4:53am UTC](https://forum.kirupa.com/t/complex-site-stats-query/270450/1 "2008-09-10T04:53:48Z")

</div>

Hello,

I’m building statistics for a site and I want to output goal percentages.

What Im trying to achieve is a query to: group all unique ‘ips’, return there max ‘goal’, and add up ip’s based on there goal.

![](http://www.l2image.com/images/fubvatyavqv6mpxonjvz.gif)

This shows what I’ve done and what it currently returns. Hopefully better to visualize!

If you have any idea ill run through my data to see if it works.

Thanks!
