C#中的数据库查询 [英] database queries in c#

查看:56
本文介绍了C#中的数据库查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从3个表中检索数据并使用c#和Access数据库插入一个表中,这可能吗?所有表都有一个逗号字段,可用于链接4个表.您能建议我一些实现此目标的方法吗?

I want to retrieve data from 3 tables & insert into one table using c# & Access database, is it possible? All tables have one comman field which can be used to link 4 tables. Can you suggest me some way to achieve this?

推荐答案

尝试
select  A.a,B.B, C.c
        into [NEW_TABLE]
        from A
        inner join B on A.id = B.Aid
        inner join C on B.id = C.Bid


尝试
insert into Table4 select t1.ColumnName,t2.ColumnName,t3.ColumnName from Table1 t1,Table t2,Table t3 
where t1.ColumnName = t2.ColumnName and t1.ColumnName = t3.ColumnName


提供所有数据库详细信息.....
give all the database details .....


这篇关于C#中的数据库查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆