Advertisement

03.12.2008 at 11:51AM PDT, ID: 23236275
[x]
Attachment Details

join two tables where they share the same id

Asked by lobos in MS SQL Server

I am doing a select on a table that has 5 columns and the sixth column is an id field that has its corresponding value in another table. So I need to perform a query that will return my results from the first table but including the corresponding value from the second table.

table1
name               city               country                             id
john                                chicago            canada            1
paula            berlin            germany            4
manuel            lisbon            portugal                            3
jean            paris            france            2


table2
id            language
1            english
2            french
3            portuguese

so the results would be as follows

name               city               country                           id      language
john                                chicago            canada            1      english
paula            berlin            germany            4      german
manuel            lisbon            portugal                           3      portuguese
jean            paris            france            2      french


thanks.Start Free Trial
 
Loading Advertisement...
 
[+][-]03.12.2008 at 11:59AM PDT, ID: 21109490

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 12:07PM PDT, ID: 21109579

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 12:15PM PDT, ID: 21109651

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 12:17PM PDT, ID: 21109671

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2008 at 12:19PM PDT, ID: 21109688

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 05:09PM PDT, ID: 21157416

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 05:50AM PDT, ID: 21160914

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Sign Up Now!
Solution Provided By: derekkromm
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.19.2008 at 12:29PM PDT, ID: 21164982

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.19.2008 at 12:32PM PDT, ID: 21165009

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628