string not equal query, postgresql 9.4.4

From: John Scalia <jayknowsunix(at)gmail(dot)com>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: string not equal query, postgresql 9.4.4
Date: 2015-09-17 01:14:25
Message-ID: 55FA13F1.7060204@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

Having a bit of a head-scratching problem. I'm writing a query where I want to output only distinct rows where one char(4) field does not equal a specific value. Something like:

select distinct testname where result <> 'PASS"; #i.e., only the FAIL or WARN tests

I've tried several different variants like "!~", "not like ('PASS')", "is distinct from 'PASS'", and so forth, but obviously I'm missing something as every row is being output not
just the ones which do not equal PASS. What would be the correct syntax for this in a 9.4.4 database?
--
Jay

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2015-09-17 02:23:11 Re: string not equal query, postgresql 9.4.4
Previous Message Tom Lane 2015-09-15 22:43:23 Re: Need to calculate PostgreSQL memory usage