Return only unique id's that are not associated with value - Mailing list pgsql-novice

From Dimitri
Subject Return only unique id's that are not associated with value
Date
Msg-id AANLkTi=UCGDeVpSJSF+_HiVjeSWDdJaBQz9YMGMOMxq5@mail.gmail.com
Whole thread Raw
Responses Re: Return only unique id's that are not associated with value  (Vibhor Kumar <vibhor.kumar@enterprisedb.com>)
List pgsql-novice
Hi all, I'm attempting to use two tables and do the following in query:

Return all instances where a unique rpt_id does not contain an fname entry of 'useOnlyMostRecentScan'.  This should not return rows that have 'vuln-severity' but only unique rpt_id's that cannot be associated with that value at all.  Below are the example tables, any help would be greatly appreciated.

report_filters
rpt_id fname
951 useOnlyMostRecentScan
951 vuln-severity
932 vuln-severity
952 vuln-severity
952 useOnlyMostRecentScan
950 useOnlyMostRecentScan

reports
rpt_id rpt_name
951 Test1
951 Test1
932 Test2
952 Test3
952 Test3
950 Test4


I thought a WHERE NOT EXISTS and having statement would work but it either returns the whole set or none of it, I'm thoroughly confused at this point.


pgsql-novice by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: Accessing dead rows within postgresql
Next
From: Dimitri
Date:
Subject: ERROR: synatx error at or near "group"