Re: Casting integer to boolean - Mailing list pgsql-sql

From Tod McQuillin
Subject Re: Casting integer to boolean
Date
Msg-id 20020816164529.S5079-100000@glass.pun-pun.prv
Whole thread Raw
In response to Casting integer to boolean  (Bhuvan A <bhuvansql@linuxfreemail.com>)
Responses Re: Casting integer to boolean
List pgsql-sql
On Fri, 16 Aug 2002, Bhuvan A wrote:

> How do i cast an integer value to boolean?

You can always do something like this:

select not count(*) = 0 from my_table;

Basically, for any integer i, convert to boolean with:  not i = 0
-- 
Tod McQuillin



pgsql-sql by date:

Previous
From: Bhuvan A
Date:
Subject: Casting integer to boolean
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Casting integer to boolean