如何将两个或多个表映射到sql asp.net中的一个表中 [英] how to map two or more tables into one table in sql asp.net
本文介绍了如何将两个或多个表映射到sql asp.net中的一个表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将两个或多个表映射到sql asp.net中的一个表中
例如
table1 = employee_details
employee_id emp_name emp_address状态
< br $>
table2 = company_emplyee
emplyee_id Emp_salary location
输出:Company_Name
employee_id emp_name emp_address Emp_salary位置状态
如何将表合并为1个单表过滤所有数据。
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 .
推荐答案
这可能对你有帮助..
Datatable Merge [ ^ ]
SQL连接 [ ^ ]
this might help you..
Datatable Merge [^]
SQL Joins[^]
你可以这样做:
Hi,
you could do something like this:
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
这篇关于如何将两个或多个表映射到sql asp.net中的一个表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文