Skip to content

Commit

Permalink
update postgres query
Browse files Browse the repository at this point in the history
  • Loading branch information
mchmarny committed May 8, 2023
1 parent b8801d4 commit f0605c6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions examples/query.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ SELECT distinct image from vul order by 1;
SELECT
image,
count(*) records,
DATE(MIN(processed)) min_updated,
DATE(MAX(processed)) max_updated
FROM vul
MIN(imported) min_updated,
MAX(imported) max_updated
FROM vulns
GROUP BY image
ORDER BY 1;

-- list image versions
SELECT
digest,
count(*) records,
DATE(max(processed)) updated
FROM vul
max(imported) updated
FROM vulns
WHERE image = 'docker.io/bitnami/mariadb'
GROUP BY digest
ORDER BY 3;

-- list image vulns per day
SELECT
DATE(processed) updated,
imported,
count(*) records
FROM vul
FROM vulns
WHERE image = 'docker.io/bitnami/mariadb'
GROUP BY DATE(processed)
ORDER BY 1;
GROUP BY imported
ORDER BY 1 DESC;

0 comments on commit f0605c6

Please sign in to comment.