troubleshooting Question

SQL Question

Avatar of hackman122
hackman122 asked on
Microsoft SQL ServerMicrosoft SQL Server 2008Databases
6 Comments1 Solution42 ViewsLast Modified:

I have a table with the following columns and data:

 BatchID ClaimID   ClaimStatus
   1          1A             Success
   1          1B             Success
   2          2A              Fail
   2          2B              Fail
   3         3A              Success
   3      3B              Fail

I would like to select the batches that have no claims failed.

In this case I would only want batch 1, because all the claims have status = success. I don't want batch 2 because both claims have status = fail and I don't want batch 3 because 1 of the claims has status = fail.

There could be multiple claims in a batch. That means that even if I had a batch with 10 claims and 9 had status = success and 1 had status = fail, I would not want to select that batch.

Help please :)

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 6 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004