Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 Help with this problem sql
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

crosskarl
Starting Member

1 Posts

Posted - 02/01/2013 :  05:12:00  Show Profile  Reply with Quote
I am working with a world database that contains every land, continent, gpd(gross domestic product), population and area. I'm having a problem with writing out continents where every land in the continents gdp is not null. table is named world.

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 02/01/2013 :  06:33:02  Show Profile  Reply with Quote

SELECT land, continent, gpd, population ,area
FROM
(
SELECT *,
COUNT(CASE WHEN gdp IS NULL THEN 1 ELSE NULL END) OVER (PARTITION BY continent) AS gdpcnt
FROM world
)t
WHERE gdpcnt=0


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next 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