March 7, 2006 at 7:05 am
Hi,
I have two tables:
one is Department - DepartmentName, DepartMentID
and other is Employee - EmpName, EmpAdd, DepartmentID,etc. (There are 15 columns in Employee Table)
What I want is
All the columns from Employee Table and DepartName from Department table where DepartmentID is from Employee Table (Employee.DepartmentID)
In result DepartmentName column should combine with columns from Employee Table.
This is urgent, Please suggest how to do it.
Thanks, Swapnil
March 7, 2006 at 7:21 am
select d.DepartmentName, e.EmpName, e.EmpAdd, e.DepartmentId, ...etc
from Department d
join Employee e on e.DepartmentId = d.DepartmentId
March 7, 2006 at 9:40 pm
Thanks Karl Grambow
But there are 15 columns so I have to write all 15 column names. Is there any way that we don't need to write all column names.
Swapnil.
March 8, 2006 at 12:33 am
select d.DepartmentName, e.*
from Department d
join Employee e on e.DepartmentId = d.DepartmentId
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply