SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 correcting a simple join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

idb65
Starting Member

4 Posts

Posted - 04/30/2013 :  17:37:35  Show Profile  Reply with Quote
Hello my friends

i have these to tables

country: country_code,population
is_member: organization,country_code


now i want name of organizations with the sum of the population of their members countries

i wrote this but i think it is not correct

selec mem.organization,sum(co.population)
from country co
join is_member mem
on co.country_code=mem.country_code;


thank u so much for ur help

I use oracle 11g

best

singularity
Posting Yak Master

151 Posts

Posted - 04/30/2013 :  20:41:21  Show Profile  Reply with Quote

select mem.organization,sum(co.population)
from country co
join is_member mem
on co.country_code=mem.country_code
group by mem.organization;
Go to Top of Page

idb65
Starting Member

4 Posts

Posted - 05/01/2013 :  03:13:57  Show Profile  Reply with Quote
Thank you so much.


quote:
Originally posted by singularity


select mem.organization,sum(co.population)
from country co
join is_member mem
on co.country_code=mem.country_code
group by mem.organization;


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000