C#从多个表中搜索 [英] C# Search from multiple tables

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

问题描述


我在C#构建Windows窗体应用程序

i在数据库数据库中有3个表,其中PID是常见的 colum 所有表中的列名

我需要一个搜索查询,从多个表中搜索整个Sql数据库?

Hi I''m building windows form application in C#
i have 3 tables in the databse database in which "PID" is common colum column name in all the tables
"I need a search query which search from multiple tables Across the Sql database?"

推荐答案

您可以在PID colom上使用内部联接,并可以创建搜索查询。
You can use inner joins on PID colom and can create search query.


如果您之间有关系图



使用: -




If you have A relationship Diagram between them

use:-


select ...,...,...,... from table1,table2,table3





没有关系图使用内连接: -





Without a relationship Diagram use inner join:-

select ....,...,....,.... from table1 inner join table2
on table1.PID=table2.PID 
inner join table3
on table2.PID=table3.PID 


这篇关于C#从多个表中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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