Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to map two or more tables into one table in sql asp.net


for example


table1=employee_details
employee_id emp_name emp_address status



table2= company_emplyee
emplyee_id Emp_salary location

output:Company_Name
employee_id emp_name emp_address Emp_salary location status

how to merge both the table into 1 single table filtering all data .
Posted

this might help you..

Datatable Merge [^]

SQL Joins[^]
 
Share this answer
 
Hi,

you could do something like this:

SQL
INSERT INTO Company_Name (
  employee_details.employee_id
  ,employee_details.emp_name
  ,employee_details.emp_address
  ,company_emplyee.Emp_salary
  ,company_emplyee.location
  ,employee_details.status)
SELECT
  employee_details.employee_id
  ,employee_details.emp_name
  ,employee_details.emp_address
  ,company_emplyee.Emp_salary
  ,company_emplyee.location
  ,employee_details.status
FROM 
  employee_details
  INNER JOIN company_emplyee ON
    company_emplyee.employee_id = employee_details.employee_id
 
Share this answer
 
v3

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