4ccb980593
Initial Job Collector (changes pending) * movearroundtocleancollector * internalgetfunctions * completecollectorquery * simplify * fixtests * addvendor * noplaceholder
7 lines
367 B
SQL
7 lines
367 B
SQL
CREATE VIEW activeCollectorsWithRequiredIDs AS
|
|
SELECT DISTINCT c.id, c.activeVersion, array_agg(q.queryId) as queryIds
|
|
FROM collectors as c
|
|
LEFT JOIN collectorQueries as q ON c.id = q.collectorId
|
|
AND c.activeVersion >= q.addedVersion
|
|
and c.activeVersion < COALESCE(q.removedVersion, c.activeVersion + 1)
|
|
GROUP BY c.id, c.activeVersion; |