Home > Blockchain >  Select different min dates BigQuery
Select different min dates BigQuery

Time:12-02

Input and expected output

I have a table with different values in BigQuery and I want to select the min or the max of these values.

CodePudding user response:

You can use min/max with group by to get min or max date per ID group

SELECT ID, MIN(DATE) AS MIN_DATE, MAX(DATE) AS MAX_DATE
FROM TABLE
GROUP BY ID 
  • Related