Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assistance find dups - another issue

Status
Not open for further replies.

kermit01de

Technical User
Jan 20, 2002
256
0
0
DE
For this example:

Table SalesLine
Field [orderno.]
Field [Debitor]
Field [item]

orderno. - Debitor - item
10001 12345 1010101
10001 12345 1122334
10001 12345 1111111
10002 12222 1010101
10002 12222 1122222
10002 13344 1231231
10003 14444 1010111

Now I have to find all orderno. that have more that one Debitor

In this case the select should give back the 10002

Any hint from anyone - would be very nice ...

Kind regards

Mirko

Kind regards
Mirko
--------------------------------------
>>>>>> ... I am sure, some supportissues are a matter of PEBKAC ... <<<<<
 
try this:

Code:
Select OrderNo
From   SalesLine
Group By OrderNo
Having Count(Distinct Debitor) > 1

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top