Re: select items based on 2 columns

From: Frank Streitzig <fstreitzig(at)gmx(dot)net>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: select items based on 2 columns
Date: 2022-08-08 09:32:17
Message-ID: YvDYIan0yU4IpL+t@frastr-dev
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Am Mon, Aug 08, 2022 at 09:24:14AM +0100 schrieb Shaozhong SHI:
> The following is the type of data:
>
> id id_b in out
> 51 57 false false
> 51 42 true false
> 51 32 false false
> 51 76 false true
> 51 49 true false
>
>
> How to do the following:
>
> select id from tbl if in is true and out is true are found?

Untested:
select t.id from tbl t where t.in and t.out;

Best regards,
Frank

>
> Regards,
>
> David

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Pierre Chevalier 2022-08-08 16:17:50 Re: select items based on 2 columns
Previous Message Shaozhong SHI 2022-08-08 08:24:14 select items based on 2 columns