We help IT Professionals succeed at work.

Select query from 2 tables

401 Views
Last Modified: 2014-08-12
I have two tables. One table is called Employees and one is called Teams.

In the Employee table I have the following columns (Name, StartDate, Position, TeamID)
In the Teams table I have the following columns (URL, Active, TeamID)

I want to select Name, StartDate, and Position from the Employee table
as well as
URL, and Active from the Teams table
Where the ID is the same

For example...
Employee record: Mike Smith | 1/1/1980 | Comptroller | 55
Teams record: www.google.com | Yes | 55

would display this in the result:

Mike Smith 1/1/1980 Comptroller www.google.com Yes

How do I do this?
Comment
Watch Question

Associate Principal Engineer
CERTIFIED EXPERT
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
David ToddSenior Database Administrator
CERTIFIED EXPERT

Commented:
PortletPaulEE Topic Advisor
CERTIFIED EXPERT
Most Valuable Expert 2014
Awarded 2013

Commented:
another SQL tutorial site: http://sqlzoo.net/wiki/Main_Page
Hamed NasrRetired IT Professional
CERTIFIED EXPERT

Commented:
Agree with Vikas Garg's comment as a direct answer. Other comments help in the learning process.

If you need more info on INNER JOIN to join more tables see this article:
INNER JOIN a Number of Tables
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.