Solved

get data from multiple tables

Posted on 2011-03-10
4
394 Views
Last Modified: 2012-05-11
I have two tables
a. manager
b. team

manager table has manager_id,manager_name

team table is the table which contains team member which reports to a manager in manager table.
Team table has 3 columns, manager_id, Team_member_name, Team_member_address

I need to display a result set with column Manager_name, Team_member_address.

Please help
0
Comment
Question by:dojjol
[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
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 167 total points
ID: 35096577
I would look at a redesign and self-join.

Create an 'employee' table then have manager_id reference the emp_id.  There are a tone of links on this type of design.

Based on what you have (assuming manager_name is in the manager table):
select manager_name, address from
manager, team
where manager.name=team.manager_name
0
 
LVL 15

Assisted Solution

by:derekkromm
derekkromm earned 167 total points
ID: 35096635
select m.manager_name, t.team_member_address from
manager m
inner join team t
on m.manager_id = t.manager_id
0
 
LVL 24

Assisted Solution

by:jimyX
jimyX earned 166 total points
ID: 35096653
select m.Manager_name, t.Team_member_address from manager m, team t where m.manager_id = t.manager_id;
0
 

Author Closing Comment

by:dojjol
ID: 35129949
not a solution, I was looking for
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

734 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