Skip to content

Instantly share code, notes, and snippets.

@afcotroneo
Created May 20, 2021 17:45
Show Gist options
  • Select an option

  • Save afcotroneo/34a022dc8ae786f887857c9d5d626362 to your computer and use it in GitHub Desktop.

Select an option

Save afcotroneo/34a022dc8ae786f887857c9d5d626362 to your computer and use it in GitHub Desktop.
CREATE VIEW v_satellitecurrentlocation AS (
SELECT
*
FROM
satellitelocations t1
INNER JOIN (
SELECT
MAX(postimestamp) as postimestamp,
satid
FROM
satellitelocations
GROUP BY
2
) t2 ON t1.postimestamp = t2.postimestamp
AND t1.satid = t2.satid
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment