From: | Dimitri <a(dot)dmitri(at)gmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | ERROR: synatx error at or near "group" |
Date: | 2011-03-19 04:55:32 |
Message-ID: | AANLkTimNp2-8e75D11P+k2U=c9UtzBRX2D9nE1ra_Nwf@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
This query was working fine until I added another set of nested
conditions... I've added three (3) asterisks (*) in front of each bit that I
added before this error appeared, these are not in the actual query:
/* Query to pull non-SDS scans where alerts are not configured properly */
select site_name, site_alerts.site_id, alert_key, *** alert_value from
alert_settings as als
JOIN alerts a on als.alert_id = a.alert_id
JOIN site_alerts sa on als.alert_id = sa.alert_id
JOIN alert_conds ac on als.alert_id = ac.alert_id
JOIN sites s on sa.site_id = s.site_id
where ((alert_key = 'recipient' and alert_setting not ilike 'TMSISS%')
OR (alert_key = 'server' and alert_setting not ilike 'smtp-relay.sct.com:25
')
OR (alert_key = 'sender' and alert_setting not ilike 'r7(at)sungardhe(dot)com')
OR (alert_key = 'verbose' and alert_setting not ilike '1')
*** OR (alert_cond = 'scan-status' and ((alert_value not ilike 'i') or
(alert_value not ilike 's') or (alert_value not ilike 'e') or (alert_value
not ilike 'p') or (alert_value not ilike 'r'))
*** OR (alert_cond = 'vuln-severity' and alert_value not ilike '1'))
AND alert_name not ilike 'SDS%'
group by sa.site_id, site_name, alert_key
order by site_name;
This returns ERROR: synatx error at or near "group" when I run it in the
Query window in PGAdmin3
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-03-19 05:10:47 | Re: ERROR: synatx error at or near "group" |
Previous Message | Dimitri | 2011-03-19 04:15:02 | Return only unique id's that are not associated with value |