Forum

Write a query to di...
 
Notifications
Clear all

Write a query to display all the town names which have summer temperatures more than jaipur


Rahul Updhyay
Posts: 17
Topic starter
(@rahul)
Active Member
Joined: 1 year ago

Write a query to display all the town names which have summer temperatures more than jaipur. the output should be sorted on the town name.

2 Replies
Deepak Raj
Posts: 18
 Deepak Raj
(@Deepak Raj)
Joined: 1 year ago

I hope the below will work. Any other solutions are welcome.

Select townname
from Resort
Inner join Town On Resort.resortID=Town.townID
AND Town.SummerTemp> (Select Town.SmmerTemp where Town.towname="JAIPUR")
Order By townname
Reply
1 Reply
KV Kumar
Admin
(@vinodkrsetty)
Joined: 2 years ago

Member
Posts: 27

Consider the table called the town and it has two columns like town name and summer temperature then our query would be something as below. 

Alias 

  • TOWN NAME is TOWN_NAME
  • SUMMER TEMPERATURE  is SUMMER_TEMP
  • TOWN is TWN
select TOWN_NAME from TOWN TWN
where TWN.SUMMER_TEMP>(select SUMMER_TEMP from TOWN where TOWN_NAME='JAIPUR')
order by TOWN_NAME;
Reply
Share: