使用SQL 2012从数据库检索数据时获取重复记录
问题描述:
终于得到了解决方案,而不是明显我也使用了groupby它解决了我的问题
我尝试了什么:
得到解决方案
Hi ,finally got the solution instead of distinct i also used groupby it solved my problem
What I have tried:
got the solution
答
如果您的帐单表包含同一案例的多个帐单信息JOIN
将为每个结算信息返回一个完整的行。一个简单的例子来说明这个:
caseID = 5
账单信息A for caseID 5
账单信息B for caseID 5
将返回以下行:
5与A
5与B
If your billing table contains more than one billing information for the same case theJOIN
will return a complete row for each billing info. A simple example to illustrate this:
caseID = 5
billing info A for caseID 5
billing info B for caseID 5
will return these rows:
5 with A
5 with B