X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 948C8D89BF for ; Sat, 10 Sep 2005 13:35:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42408-08 for ; Sat, 10 Sep 2005 16:35:21 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 48A40D89A8 for ; Sat, 10 Sep 2005 13:35:20 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 601BF40C5D2; Sat, 10 Sep 2005 17:35:06 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 31ED315F1D; Sat, 10 Sep 2005 17:31:39 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06078-03; Sat, 10 Sep 2005 17:31:36 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id D4CD115ED9; Sat, 10 Sep 2005 17:31:36 +0100 (BST) Message-ID: <43230A68.4000304@archonet.com> Date: Sat, 10 Sep 2005 17:31:36 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Hoeller Cc: pgsql-sql@postgresql.org Subject: Re: how to have 2 select creteria on one column? References: <200509101745.50847.MichaelHoeller@t-online.de> In-Reply-To: <200509101745.50847.MichaelHoeller@t-online.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.058 required=5 tests=[AWL=0.008, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/107 X-Sequence-Number: 22654 Michael Hoeller wrote: > Hello, > > I would like to select every row which has got in the column CODE a "k" > but I want to exclude every "kV" -- may be it is due to the fact that > it is Saturday and I work too long I don't get it.. I tried a > subselect, union but I struggle with the two select creteria on one > column. SELECT * FROM my_table WHERE code = 'k' AND code <> 'kV' ; HTH -- Richard Huxton Archonet Ltd