Greatest / Least AQL Functions

It would be lovely if AQL had something that would take the greatest or least between two or more values (within the same row). I use this in BigQuery constantly. There’s a workaround in AQL to use case when, so it’s not super important, but definitely would be nice to have.

I did just see SQL Passthrough Functions which might be a good way to do this for BQ. Still could be a cool idea to add in native AQL, but as mentioned, there are a few options to accomplish this so not important. And I understand that it might not be easy implementation if other SQL dialects don’t support something similar.

Hi @anya.conti, Thank you for the suggestion.

GREATEST and LEAST are now part of the SQL standard, though there are some minor differences across implementations in how NULL values are handled.

This looks like it could be a quick win, so we’ll review it and see what we can do here.

1 Like

Thanks Tan! As mentioned, definitely not urgent or a priority but would simplify the definitions of quite a few fields.