Skip site navigation (1) Skip section navigation (2)

Re: Simon Moses Qs

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Simon Moses" <ks_moses(at)yahoo(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Simon Moses Qs
Date: 2004-06-12 22:56:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi Simon-

You have the JDBC list here.
The SQL list might be a better place for future questions of this sort.

Here's one way to do it:

prod1=# create table testone (a boolean, b text);
prod1=# insert into testone values ('t','true');
INSERT 485595194 1
prod1=# insert into testone values ('f','false');
INSERT 485595195 1
prod1=# select b || case when (a) then ' is true' else ' is false' end
prod1-# from testone;
 true is true
 false is false
(2 rows)

Nick Fankhauser

nickf(at)doxpop(dot)com  Phone 1.765.965.7363  Fax 1.765.962.9788
doxpop  - Court records at your fingertips -


-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Simon Moses
Sent: Saturday, June 12, 2004 8:52 AM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] Simon Moses Qs

dear sir,
i am using postgresql 7.2.
i want to concatenate 'character varying' and 'boolean' ex.
select character_varying_field||boolean_field as new_field from table_name;
or any function to convert 'boolean' to 'character varying' so that i can
select character_varying_field||convert_function(boolean_field) as new_field
from table_name;
thanks in advance
simon moses.

Visit My Home Page updated: 20 June 2003.
Simon Moses

Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

In response to

pgsql-jdbc by date

Next:From: Jouneau LucDate: 2004-06-14 07:25:18
Subject: Re: [ADMIN] doubt
Previous:From: Simon MosesDate: 2004-06-12 13:52:08
Subject: Simon Moses Qs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group