Re: Retrieve rows that have specific value in any of columns.

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Lukasz Brodziak *EXTERN*" <lukasz(dot)brodziak(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Retrieve rows that have specific value in any of columns.
Date: 2013-08-12 07:15:06
Message-ID: A737B7A37273E048B164557ADEF4A58B17C0144F@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Lukasz Brodziak wrote:
> I have a table which contains 5 columns the last 3 indicate wether the
> employer worked with given project or not. The values are simply Yes
> and No. What I need is a list of people who haven't worked in at least
> one project.
> So for example we have data:
>
> John Smith Yes No Yes
> Tim Robins No No Yes
> Joe Bar Yes Yes Yes
> Ben Finch Yes No No
>
> So the SQL statement should retrieve: Finch,Robins and Smith.

... WHERE NOT (p1 AND p2 AND p3)

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David F. Skoll 2013-08-12 15:28:33 Opinions on SSDs
Previous Message Lukasz Brodziak 2013-08-12 07:12:36 Retrieve rows that have specific value in any of columns.