Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

get data from multiple tables

Posted on 2011-03-10
4
Medium Priority
?
400 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
4 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 501 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 501 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 498 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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