From this table what is the most efficient way of selecting a column of distinct ParentMeetingID values where all of its ChildMeetingID values do not have a Finalised value of 2 please?
So a select script executed on the example table should return a column with values of 2343, 2348, and 2388.
None of the columns will ever be NULL.
Thank you.
ParentMeetingID | ChildMeetingID | Finalised |
---|---|---|
2315 | 2316 | 2 |
2317 | 2318 | 2 |
2317 | 2366 | 1 |
2317 | 2367 | 2 |
2317 | 2368 | 2 |
2325 | 2365 | 2 |
2335 | 2341 | 2 |
2343 | 2344 | 0 |
2343 | 2345 | 0 |
2343 | 2355 | 0 |
2346 | 2347 | 2 |
2348 | 3395 | 0 |
2349 | 2350 | 2 |
2351 | 2352 | 2 |
2353 | 2354 | 2 |
2357 | 2358 | 2 |
2357 | 2359 | 2 |
2357 | 2360 | 2 |
2357 | 2361 | 2 |
2362 | 2551 | 2 |
2388 | 2389 | 1 |
2388 | 2390 | 1 |
2388 | 2391 | 1 |