I have the following table (I have covered up the current_holder column for privacy reasons):
For each row, I want to find the number of times we could pull 4 unique objects out of a bag (the objects being keys, skulls, gems, coins, daggers and crowns) without return. For example, in row 1 I could do this 6 times since once all of the skulls are taken out there are now only 3 unique objects left in the bag. For row 2 there is no way of pulling out 4 unique objects. For row 3 I could do this 5 times since after all the skulls are taken out there would still be one more combination of 4 unique objects left.
Does anyone know how I could calculate this number in BigQuery?

You could select the sum of the 3 lowest values.
[0, 0, 6]so the sum is 6.[0, 0, 0]-> 0[0, 4, 5]-> 9This query calculates that:
(It is a little verbose...you could probably do this simpler but it works to calculate the number you are looking for.)