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 |
luka
Starting Member
8 Posts |
Posted - 2015-02-11 : 12:42:46
|
Hello, i am new to SQL. I am trying to Show the countries in Europe with a per capital GDP greater than 'United Kingdom'. I have got table world that has countryname,continent,GDP, and area columns. Thx luka |
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2015-02-11 : 15:37:27
|
kind of a general question, but you are basically doing 2 steps, 1st you are identifying the gdp of united kingdom, the you are running a query to give you everything higherdeclare @gdp moneyset @gdp = (select top 1 gdp from mytable a where a.countryname = 'United Kingdom'select * from mytable awhere a.gdp > @gdporder by gdp desc Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
|
|
luka
Starting Member
8 Posts |
Posted - 2015-02-11 : 15:44:02
|
Thank you so much. |
|
|
|
|
|