Skip to content
Advertisement

Select nearest date from another table SQL

I have two tables in BigQuery:

table 1:

table 2:

I would like to add the nearest SentDateTime where the EventDateTime is greater than than the SentDateTime. So outcome should look like this:

Advertisement

Answer

Below is for BigQuery Standard SQL

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