grouping two tables which have different number of data (1 Viewer)

mhisma

Registered User.
Local time
Today, 17:15
Joined
Sep 20, 2007
Messages
28
Hi All,
I have two tables

Table A

EmpID EmpName
001 Will
002 Jack
003 Emma
004 Greg

Table B
EmpName EmpHobby
Will Sport
Jack Reading

I wanna join the two table by using query so the result will be

EmpID EmpName EmpHobby
001 Will Sport
002 Jack Reading
003 Emma (blank)
004 Greg (blank)

what query should I write

Kindly need your help,i am frustrating with this
 

EMP

Registered User.
Local time
Today, 10:15
Joined
May 10, 2003
Messages
574
In query Design View, double click on the line joining the EmpName fields in the two tables. In the dialog that pops up, select the option that includes all records from Table A. Click OK.


Or write in SQL View,

SELECT [Table A].EmpID, [Table A].EmpName, [Table B].EmpHobby
FROM [Table A] LEFT JOIN [Table B] ON [Table A].EmpName=[Table B].EmpName;

^
 
Last edited:

mhisma

Registered User.
Local time
Today, 17:15
Joined
Sep 20, 2007
Messages
28
yes, it worked very well

thank you so much
 

Users who are viewing this thread

Top Bottom