Questions

Can I efficiently sum/count total clicks/conversions from a separate table?

While wrong, here is an example. SELECT i.aid as aid, count(i.id) as views, COALESCE(SUM(click),0) as clicks, COALESCE(SUM(con),0) as conversions FROM impressions as i LEFT JOIN ads_stats_clicks WHERE i.aid IN (3,4,21,40,41) GROUP BY i.aid #1 - I need clicks/conversions sum for each aid As it stands I am running two separate queries. One to request initial data and a second to request clicks/conversions. I feel like it may be possible to efficiently combine this into one query.

1answers

This is a question better suited for stackoverflow.

If you message me the schema for the two tables I could give you the exact query that you want.


Answered 5 years ago

Unlock Startups Unlimited

Access 20,000+ Startup Experts, 650+ masterclass videos, 1,000+ in-depth guides, and all the software tools you need to launch and grow quickly.

Already a member? Sign in

Copyright © 2024 Startups.com LLC. All rights reserved.