Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Query Help

Posted on 2011-03-10
4
Medium Priority
?
288 Views
Last Modified: 2012-05-11
Hi,
  Please find the attached file for the table export data. It has id, name and containingregion columns.
containingregion column has id which connects to other location in the same table.

My problem here is  when I give an id I need to get country for that id and continent for that ID in two queries. my problem here is some times the ID might be county record, some times the ID might be state ID..when I give ID I need to get country, state and continent. if the id is country id, then I need to get state as null, country as this record and continent should be the continent of the record.

I need it in three queries, one for state, one for country and one for continent. Please let me know how can I do it.

Thanks
table-export.xls
0
Comment
Question by:Sthokala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
Akenathon earned 750 total points
ID: 35096983
Please post your expected results as a spreadsheet, it's difficult to follow the written explanation.
0
 
LVL 2

Assisted Solution

by:swadhinray
swadhinray earned 750 total points
ID: 35124932
Name is the country name what you are expecting but I think there should be one more table containing your location and continent information.

Boz one continent can have multiple location and you location which ID in your file should always be unique so based on that you need to make a relation and get the expected result and as Akenathon: said to provide a expected result then it will be easier to understand what you are looking for as when i did a select on each ID I am able to get the result like below:

ID      NAME      REGIONCODE      CONTAININGREGION      STATE_PROVINCE_IND      REGION_TYPE
3975      United States      US      3965      N      CNTRY


Which seems to be a good data.

Better to provide a expected result you are looking for.
0
 

Author Comment

by:Sthokala
ID: 35131315
Thanks Guys for your rsponse. I found the solution for this.
0
 

Author Closing Comment

by:Sthokala
ID: 35131330
Found solution
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question