如果asp.net中的数据库表的两个字段相等,如何从数据库获取数据 [英] how to get data from database if two fields of database table is equal in asp.net

查看:80
本文介绍了如果asp.net中的数据库表的两个字段相等,如何从数据库获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表,一个是Earning Master,另一个是OT master ...
在收入管理员中,如果员工名称和ID等于收入管理员,我想从OT管理员那里获得OT时间...
谁能说出如何获取它……使用asp.net c#

hi i have two tables one is Earning Master and another one table is OT master...
in the earning master i want to get OT hours form OT master if Employee name and ID is Equal to the Earning Master...
can anyone tell how to get it... using asp.net c#

推荐答案

ASP.NET与它无关.它不运行SQL. C#与它无关.您的问题是一个SQL问题.

您可以通过两个表之间的联接来做到这一点.这是非常基本的SQL,也许您应该阅读一些基本的在线文章并了解其工作原理?

从EaringMaster内在otMaster上的OTMaster ID中选择* ot.ID = em.ID
ASP.NET has nothing to do with it. It does not run SQL. C# has nothing to do with it. Your question is a SQL question.

You''d do this with a join between the two tables. This is very basic SQL, perhaps you should read some basic online articles and learn how it works ?

select * from earningMaster em inner join OTMaster ot on ot.ID = em.ID


这篇关于如果asp.net中的数据库表的两个字段相等,如何从数据库获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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