Skip to content
Advertisement

SQL select unique name based on max index

I have the following table

I want to return

what I have come up with so far is, the following. but I can’t figure out how to pull the name from the table when at the max index and where the number is not null?

Advertisement

Answer

Below is for BigQuery Standard SQL

if to apply to sample data from your question – output is

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement