Click here to Skip to main content
15,899,556 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here i am using two table namely EMPLOYEE(ID,ECODE,DEPT) and DEPARTMENT(ID, DEPARTMENTNAME),
My table

Employee Department

ID Ecode Dept ID deptName
1 10 1 1 Admin
2 20 2 2 prodn
3 30 3 3 Accounts
4 40 5
5 50 3
6 60 3
7 70 4
8 80 5
9 90 6
10 100 2


here i want to match DEPARTMENT(ID) with EMPLOYEE (DEPT)......
how can i do it

Thanks for Advice and spend your gloden time for me
Posted
Updated 29-Jan-14 14:28pm
v2

Try this using Inner Join[^]

SQL
select e.*,d.* from Employee e inner join Department d on e.dept = d.ID
 
Share this answer
 
Hi try this Query,

Select * from Employee e
Inner Join Department d on d.ID = e.dept
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900