table = ((8, 2, 9), (4, 5, 6), (2, 1, 9))
my_sum = sum(row[0] for row in table if row[2] == 9)
# assert my_sum == 10
my_lst = [row[0] for row in table if row[2] == 9]
# all row[2] == 9 therefore OrderBy is a no-op in your example
# assert my_lst == [8, 2]