I have a query like this:
select *, (CAST (ie_usage_count as float)/total_count)*100 as percent_ie from(
SELECT DISTINCT CAST (account_id AS bigint),
count(case when
user_agent LIKE '%MSIE 7%'
AND user_agent NOT LIKE '%Trident%'
then 1 end) as ie_usage_count,
count(*) as total_usage
FROM acc_logs
WHERE account_id NOT LIKE 'Account ID '
group by account_id
ORDER BY account_id )
where not ie_usage_count = 0
That gives me a table with account_ids, and the ie_usage_count, total_usage, and percent_ie associated with each account ID
account_id | ie_usage_count | total_usage | percent_ie
I have another query
select name, account_id
from accounts
That gives me the name of the person associated with each account.
name | account_id |
I'd like to have a single query that includes name, account_id, ie_usage_count, total_usage, and percent_ie.
name | account_id | ie_usage_count | total_usage | percent_ie
Any ideas?