pgsql: only select distinct layers

This commit is contained in:
Jimmy Zelinskie 2017-01-19 17:09:57 -05:00
parent dbe522fdd5
commit ca9f340a91

View File

@ -212,7 +212,7 @@ const (
searchNotificationLayerIntroducingVulnerability = ` searchNotificationLayerIntroducingVulnerability = `
WITH LDFV AS ( WITH LDFV AS (
SELECT ldfv.layer_id SELECT DISTINCT ldfv.layer_id
FROM Vulnerability_Affects_FeatureVersion vafv, FeatureVersion fv, Layer_diff_FeatureVersion ldfv FROM Vulnerability_Affects_FeatureVersion vafv, FeatureVersion fv, Layer_diff_FeatureVersion ldfv
WHERE ldfv.layer_id >= $2 WHERE ldfv.layer_id >= $2
AND vafv.vulnerability_id = $1 AND vafv.vulnerability_id = $1