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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux