I want to select clients only when all the lines in Credit are filled. From the table I want to see only the lines for Client 1, Client 3, Client 4 and Client 5.
I was trying this:
SELECT *
FROM table
WHERE EXISTS (SELECT client FROM table WHERE [CREDIT] = 'cred')
But not working...
Thanks!
| Client | Credit |
|---|---|
| 1 | CRED |
| 1 | CRED |
| 1 | CRED |
| 1 | CRED |
| 1 | CRED |
| 2 | |
| 2 | CRED |
| 2 | CRED |
| 3 | CRED |
| 3 | CRED |
| 3 | CRED |
| 3 | CRED |
| 4 | CRED |
| 4 | CRED |
| 5 | CRED |
| 6 | |
| 6 | |
| 6 | |
| 6 | CRED |
| 6 | CRED |