Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
crosskarl
Starting Member
1 Post |
Posted - 2013-02-01 : 05:12:00
|
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
52326 Posts |
Posted - 2013-02-01 : 06:33:02
|
[code]SELECT land, continent, gpd, population ,areaFROM(SELECT *,COUNT(CASE WHEN gdp IS NULL THEN 1 ELSE NULL END) OVER (PARTITION BY continent) AS gdpcntFROM world)tWHERE gdpcnt=0[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|