Re: BOOLEAN question
От | Stephan Szabo |
---|---|
Тема | Re: BOOLEAN question |
Дата | |
Msg-id | 20021028194512.A87476-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Re: BOOLEAN question (Josh Berkus <josh@agliodbs.com>) |
Список | pgsql-sql |
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(bool), what are the chances it would get added to the core? I > don't see any good reason not to have one. Don't know really. I guess if we're saying that true>false it might make sense, although the notion of max(bool) seems odd to me, especially since it only easily handles an ANY case. Speaking of which, a more expensive but possibly nicer looking way would be something like true=ANY(select col from <whatever>) (which of course also generalizes into =ALL fairly easily)
В списке pgsql-sql по дате отправления: