Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcNmX-0007zS-FJ for pgsql-admin@arkaria.postgresql.org; Thu, 17 Sep 2015 01:14:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZcNmW-00007w-Or for pgsql-admin@arkaria.postgresql.org; Thu, 17 Sep 2015 01:14:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZcNmV-00007i-2k for pgsql-admin@postgresql.org; Thu, 17 Sep 2015 01:14:35 +0000 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZcNmS-0003Q8-B0 for pgsql-admin@postgresql.org; Thu, 17 Sep 2015 01:14:33 +0000 Received: by wicfx3 with SMTP id fx3so3474881wic.1 for ; Wed, 16 Sep 2015 18:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=Nclu2VbrdROt+Dat4pb+jFUuAks2Wn83kWtx8i9iYSg=; b=bQz0evAXjC4mDutZLDCsJY8zciQKb9f2KlakEvX8J+jIhlr8CMHQrlU6jP9iRx2Y2j JLhCzfgnU9cTdSOMnCjMAuahsPsuNLUtIYq3rCZPCh9IYWrgSKRXuaMTfBh9lhtLEhyi ELl0ULDPmynEhZonNXsgRgi+lJwScODiULhUpN4vBC9TZX3jg5zlvZ1ASAFzefvPShMC aE4PaWxNa5VLlKXtP+sKo3NNEeJF4cGJmMXxnQNVF+6i/BXENnX4aNxETBBko1zSG8aO jIuoQcD7W3DWDKRd3LTBIZ78UqSbIyZeLfiROUobrxiYfPxHW2c568w0SDmbom4mQA6m 5LcA== X-Received: by 10.180.23.231 with SMTP id p7mr24453519wif.30.1442452470083; Wed, 16 Sep 2015 18:14:30 -0700 (PDT) Received: from ?IPv6:2605:6000:f686:8500:412c:a315:c03e:2b4d? ([2605:6000:f686:8500:412c:a315:c03e:2b4d]) by smtp.gmail.com with ESMTPSA id be10sm160415wib.4.2015.09.16.18.14.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 18:14:29 -0700 (PDT) To: "pgsql-admin@postgresql.org" From: John Scalia Subject: string not equal query, postgresql 9.4.4 X-Enigmail-Draft-Status: N1110 Message-ID: <55FA13F1.7060204@gmail.com> Date: Wed, 16 Sep 2015 20:14:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org 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 spec= ific 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 d= istinct 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 --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin