Re: return true / false instead of int4 value

From: Doug Fields <dfields-pg-general(at)pexicom(dot)com>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: return true / false instead of int4 value
Date: 2002-06-04 16:19:35
Message-ID: 5.1.0.14.2.20020604121814.02c4b1e0@pop.pexicom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>select count(*) from t_table
>having count(*) > 1500000
>
>[/snip]
>
>But want to return a true/false (bool) result.

Off the top of my head:

select count > 1500000 from (select count(*) as count from t_table) as a;

Doug

Browse pgsql-general by date

  From Date Subject
Next Message Bob Powell 2002-06-04 16:49:35 Aliias names in select criteria
Previous Message Stephan Szabo 2002-06-04 16:18:23 Re: return true / false instead of int4 value