I have a function get_oversight(int)
that returns a single column:
person_id
----------
100
101
102
103
104
And another function get_unfiltered_responsibility(int)
that returns the same structure:
person_id
----------
100
103
104
I need a 3rd function that evaluates and returns a subset of the above. Here's some pseudo code:
def function get_responsibility(person_id int):
oversight = get_oversight(person_id)
unfiltered_responsibility = get_responsibility(person_id)
if number_of_records(unfiltered_responsibility) == 0:
return oversight
else
return intersection(unfiltered_responsibility, oversight)
# only ids from unfiltered_responsibility that are ALSO IN oversight
What would that 3rd function look like? (using v9.6)