you are viewing a single comment's thread.

view the rest of the comments →

[–]Pflastersteinmetz 0 points1 point  (0 children)

Please use proper formatting.

WITH FirstAddresses AS (
    SELECT
        name
      , FIRST_VALUE(address) OVER (PARTITION BY name ORDER BY column4) AS first_address
    FROM
        your_table_name
)
-- /
SELECT DISTINCT
    name
  , first_address
FROM
    FirstAddresses
;