pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedSimon Moses Qs
2+ messages / 2 participants
[nested] [flat]
* Simon Moses Qs
@ 2004-06-12 13:52 Simon Moses <ks_moses@yahoo.com>
2004-06-12 22:56 ` Re: Simon Moses Qs Nick Fankhauser <nickf@ontko.com>
0 siblings, 1 reply; 2+ messages in thread
From: Simon Moses @ 2004-06-12 13:52 UTC (permalink / raw)
To: pgsql-jdbc
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 use
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Simon Moses Qs
2004-06-12 13:52 Simon Moses Qs Simon Moses <ks_moses@yahoo.com>
@ 2004-06-12 22:56 ` Nick Fankhauser <nickf@ontko.com>
0 siblings, 0 replies; 2+ messages in thread
From: Nick Fankhauser @ 2004-06-12 22:56 UTC (permalink / raw)
To: Simon Moses <ks_moses@yahoo.com>; 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);
CREATE TABLE
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;
?column?
----------------
true is true
false is false
(2 rows)
Regards,
-Nick
---------------------------------------------------------------------
Nick Fankhauser
Business:
nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788
doxpop - Court records at your fingertips - http://www.doxpop.com/
Personal:
nick@fankhausers.com http://www.fankhausers.com
-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Simon Moses
Sent: Saturday, June 12, 2004 8:52 AM
To: pgsql-jdbc@postgresql.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
use
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-06-12 22:56 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-12 13:52 Simon Moses Qs Simon Moses <ks_moses@yahoo.com>
2004-06-12 22:56 ` Nick Fankhauser <nickf@ontko.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox