Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining two tables into one

Status
Not open for further replies.

deante

Technical User
May 26, 2005
34
US
I have two data tables, like the ones below.

Group 1
USER ID FIRST NAME LAST NAME
AAA0QTB AARON ADAMS
AAA0QTB ALEX ABRAMS
AAC0P7Y ADAM CARTER



Group 2

GPMEM_NAME GPMEM_MEMBER_ID USBD_PROGRAMMER
GROUP02B AAA0QTB GONZALEZ, ALEJANDRO
GROUP02B AAA0QTB ALI, ADYA
GROUP02B AAC0P7Y CATANO, ANDRES A

I want to run a query with a result like this one

Wanted query

USER ID FIRST NAME LAST NAME USBD_PROGRAMMER
AAA0QTB AARON ADAMS GONZALEZ,ALEJANDRO
AAA0QTB ALEX ABRAMS ALI, ADYA
AAC0P7Y ADAM CARTER CATANO, ANDRES


I BASICALLY WANT TO GROUP FIELDS FROM TWO DIFFERENT TABLES ACCORDING TO USER ID.I HOPE SOMEONE CAN HELP ME. THANKS IN ADVANCE
 
Provided the RelationShips are properly set, the query wizard should automagically join the 2 tables ...
 
Try:

SELECT table1.userID, table1.firstName, table1.lastName, table2.USBD_PROGRAMMER FROM table1 LEFT JOIN table2 ON
table1.userID = table2.GPMEM_MEMBER_ID

**Change the table names and field names to match your own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top