Table1
NoteNr | TransactionID
----------------------
4711 | NULL
4711 | 123
4812 | NULL
4913 | 444
4610 | NULL
4610 | NULL
I want to have a query which produces the following result
4812 NULL
4610 NULL
So if any entry of the same NoteNr has a value in its TransactionID Column, the NoteNr should not be in the result of the query. The Resultset should only contain NoteNrs, if all entries of the NoteNr has no value in its TransactionID Column (NULL)
MIN(CASE WHEN TransactionID IS NULL THEN 0 ELSE 1 END) = 0but since in NoteNr4711is one entry NULL, this is not working