SQL to return two of each value from table?

Reply

Join Date: Mar 2008
Posts: 78
Reputation: rickya100 is an unknown quantity at this point 
Solved Threads: 1
rickya100 rickya100 is offline Offline
Junior Poster in Training

SQL to return two of each value from table?

 
1
  #1
26 Days Ago
Hi everyone,

I sat down to create a what I thought was simple SQL query but once I got thinking about it I realised I'm not sure where to start.

The objective is to return two resorts from a Resorts table for each country code in that table.

Countries table - Lists all countries
Resorts table - Lists resorts and what country code they have which links them to the Countries table.

I've included a screenshot of what data is in the Resorts table. Basically I just need the two resort names from each country code. The other data can be ignored as it's just airport codes etc.


Any ideas to help me out?

Many thanks for any help!
Attached Thumbnails
Picture 1.png  
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 41
Reputation: baki100 is an unknown quantity at this point 
Solved Threads: 10
baki100 baki100 is offline Offline
Light Poster
 
0
  #2
25 Days Ago
i think you might want to have a look at cursors, can't think of anything else at the moment though, sorry.
Reply With Quote Quick reply to this message  
Reply

Tags
sql

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC