Of course, I meant
SELECT COALESCE( (SELECT true FROM ... WHERE ... AND boolcol LIMIT 1),
FALSE);
Jean-Luc Lachance wrote:
>
> Why not simply:
>
> SELECT COALESCE( (SELECT true FROM ... WHERE boolcol LIMIT 1), FALSE);
>
> JLL
>
> Josh Berkus wrote:
> >
> > Tom,
> >
> > > Perhaps
> > >
Why not simply:
SELECT COALESCE( (SELECT true FROM ... WHERE boolcol LIMIT 1), FALSE);
JLL
Josh Berkus wrote:
>
> Tom,
>
> > Perhaps
> > SELECT true = ANY (SELECT boolcol FROM ...);
> > or
> > SELECT true IN (SELECT boolcol FROM ...);
> >
> > Which is not to say that MAX(bool) migh
On Tue, Oct 29, 2002 at 23:19:55 +0100,
Peter Eisentraut <[EMAIL PROTECTED]> wrote:
> Josh Berkus writes:
>
> > I wrote a MAX(bool), what are the chances it would get added to the core? I
> > don't see any good reason not to have one.
>
> One reason not to have one is that Boolean values are
Josh Berkus writes:
> I wrote a MAX(bool), what are the chances it would get added to the core? I
> don't see any good reason not to have one.
One reason not to have one is that Boolean values are not naturally
ordered, so a maximum doesn't exist. (Yes, I know there are comparison
operators de
Tom,
> Perhaps
> SELECT true = ANY (SELECT boolcol FROM ...);
> or
> SELECT true IN (SELECT boolcol FROM ...);
>
> Which is not to say that MAX(bool) might not be a nicer solution;
> but you can definitely do it with SQL-spec constructs.
Based on some rough testing,
SELECT true = A
Josh Berkus <[EMAIL PROTECTED]> writes:
> Odd question: I have a query that returns a set of none to several rows. One
> column in these rows is BOOLEAN. I want the query to return:
> 1) TRUE if *any* of the BOOLEAN values is TRUE;
> 2) FALSE if *all* of the BOOLEAN values are FALSE;
> 3) FALSE
On Mon, 28 Oct 2002, Josh Berkus wrote:
> Stephan,
>
> > Well, you might be better off making a max(bool), but a not
> > super-efficient version might be:
> > max(case when col then 1 else 0 end)=1
>
> Good, I'm not just brain-dead. I did figure out another way to do it, but if
> I wrote a MAX(
Stephan,
> Well, you might be better off making a max(bool), but a not
> super-efficient version might be:
> max(case when col then 1 else 0 end)=1
Good, I'm not just brain-dead. I did figure out another way to do it, but if
I wrote a MAX(bool), what are the chances it would get added to the
On Mon, 28 Oct 2002, Josh Berkus wrote:
> Odd question: I have a query that returns a set of none to several rows. One
> column in these rows is BOOLEAN. I want the query to return:
> 1) TRUE if *any* of the BOOLEAN values is TRUE;
> 2) FALSE if *all* of the BOOLEAN values are FALSE;
> 3) FALSE
Folks,
Odd question: I have a query that returns a set of none to several rows. One
column in these rows is BOOLEAN. I want the query to return:
1) TRUE if *any* of the BOOLEAN values is TRUE;
2) FALSE if *all* of the BOOLEAN values are FALSE;
3) FALSE or NULL if no rows are returned.
I thoug
10 matches
Mail list logo