On Wed, 2008-06-25 at 14:20 +, Greg Sabino Mullane wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: RIPEMD160
>
>
> > Where the totals are "counts" of the the rows in the hits and views
> > tables. There should be no rows for partners without hits or views.
>
> How about something like th
Steve Crawford wrote:
Allan Kamau wrote:
Hi Steve,
Am having difficulties (there is a chance I could be the only one)
trying to see how the results you've listed under "I would want to
get:" section can be generated from the information you have provided
in your implicit problem statement.
R
Allan Kamau wrote:
Hi Steve,
Am having difficulties (there is a chance I could be the only one)
trying to see how the results you've listed under "I would want to
get:" section can be generated from the information you have provided
in your implicit problem statement.
Remember the events are
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
> Where the totals are "counts" of the the rows in the hits and views
> tables. There should be no rows for partners without hits or views.
How about something like this?:
SELECT partner_id, COUNT(view_id) AS total_views, COUNT(hit_id) AS tota
> select
> coalesce(h.partner_id, v.partner_id) as partner_id,
> coalesce(v.count, 0) as total_views,
> coalesce(h.count, 0) as total_hits
> from
> (select partner_id, count(*) from hits group by partner_id) as h
> full outer join
> (select partner_id, count(*) from views g
On Wed, Jun 25, 2008 at 09:50:18AM -0400, Mark Stosberg wrote:
> hits
> hit_id
> partner_id
>
> views
> view_id
> partner_id
>
> There is of course a "partners" table with a "partner_id" column.
>
> My target result is more like
>
> partner_id
> total_views
> total_hits
select
co
Hello,
I could use some help figuring out a complex "GROUP BY".
As a setup, let's say I have two tables which stores a single "hit" or
"view" in a row
hits
hit_id
partner_id
views
view_id
partner_id
There is of course a "partners" table with a "partner_id" column.
My target result is
Hi Steve,
Am having difficulties (there is a chance I could be the only one)
trying to see how the results you've listed under "I would want to get:"
section can be generated from the information you have provided in your
implicit problem statement. Please reconstruct your question, show
simpl