agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Frank Streitzig <fstreitzig@gmx.net>
To: Shaozhong SHI <shishaozhong@gmail.com>
Cc: pgsql-sql <pgsql-sql@lists.postgresql.org>
Subject: Re: select items based on 2 columns
Date: Mon, 8 Aug 2022 11:32:17 +0200
Message-ID: <YvDYIan0yU4IpL+t@frastr-dev> (raw)
In-Reply-To: <CA+i5JwYCPBDcenq_godJqtjApLyOeJHxo-Joova3wrAYtM6QOA@mail.gmail.com>
References: <CA+i5JwYCPBDcenq_godJqtjApLyOeJHxo-Joova3wrAYtM6QOA@mail.gmail.com>

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





view thread (4+ messages)  latest in thread

Message-ID: <YvDYIan0yU4IpL+t@frastr-dev>
Permalink:  ../YvDYIan0yU4IpL+t@frastr-dev/
Also on:    postgresql.org/message-id/YvDYIan0yU4IpL+t@frastr-dev

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fstreitzig@gmx.net, shishaozhong@gmail.com, pgsql-sql@lists.postgresql.org
  Subject: Re: select items based on 2 columns
  In-Reply-To: <YvDYIan0yU4IpL+t@frastr-dev>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox