Re: [SQL] concatenate question

2010-12-11 Thread Andreas Kretschmer
Tony Capobianco wrote: > Here's my table: > > plsql_dw=# \d tmpsv_parent_master >Table "staging.tmpsv_parent_master" > > Why won't this work? > plsql_dw=# select memberid || addeddate from tmpsv_parent_master limit > 10; > ERROR: operator does not exist: numeric || timestamp withou

[SQL] concatenate question

2010-12-11 Thread Tony Capobianco
Here's my table: plsql_dw=# \d tmpsv_parent_master Table "staging.tmpsv_parent_master" Column |Type | Modifiers +-+--- memberid | numeric | addeddate | timestamp witho

Re: [SQL] concatenate question

2010-12-11 Thread Edgardo Portal
On 2010-12-08, Tony Capobianco wrote: > Thanks so much to everyone for your responses. You've been very > helpful. I'm running PostGres 8.4 and we're migrating our datawarehouse > from Oracle 10.2. I guess datatype is implicitly cast in oracle under > these circumstances: > > SQL> create table

Re: [SQL] concatenate question

2010-12-08 Thread Tony Capobianco
Thanks so much to everyone for your responses. You've been very helpful. I'm running PostGres 8.4 and we're migrating our datawarehouse from Oracle 10.2. I guess datatype is implicitly cast in oracle under these circumstances: SQL> create table tony_test as select memberid||addeddate "data" fro

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
I don't know what Postgres version you're using but check out the doc related to String Functions and Operators. Cheers, Peter On Tue, Dec 7, 2010 at 4:47 PM, Tony Capobianco wrote: > Ok, that worked. Why did I need to cast both as text though? > > plsql_dw=# select memberid::text||addeddate

Re: [SQL] concatenate question

2010-12-07 Thread Richard Broersma
On Tue, Dec 7, 2010 at 1:47 PM, Tony Capobianco wrote: > Why did I need to cast both as text though? http://www.postgresql.org/docs/8.3/interactive/release-8-3.html#AEN87134 -- Regards, Richard Broersma Jr. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] concatenate question

2010-12-07 Thread Kenneth Marshall
What does a 'timestamp || numeric' actually look like? It means the timestamp written out a.k.a text and the same for numeric. The database does not know that that is what you wanted without the casts to text. Cheers, Ken On Tue, Dec 07, 2010 at 04:47:46PM -0500, Tony Capobianco wrote: > Ok, that

Re: [SQL] concatenate question

2010-12-07 Thread Dmitriy Igrishin
Hey Tony, Because there is no implicit conversion to text. 2010/12/8 Tony Capobianco > Ok, that worked. Why did I need to cast both as text though? > > plsql_dw=# select memberid::text||addeddate::text from > tmpsv_parent_master limit 5; > ?column? > -- >

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
I think the HINT is what you need to look at. Cast both columns to text. On Tue, Dec 7, 2010 at 4:37 PM, Tony Capobianco wrote: > Here's my table: > >plsql_dw=# \d tmpsv_parent_master > Table "staging.tmpsv_parent_master" > Column |Type

Re: [SQL] concatenate question

2010-12-07 Thread Tony Capobianco
Ok, that worked. Why did I need to cast both as text though? plsql_dw=# select memberid::text||addeddate::text from tmpsv_parent_master limit 5; ?column? -- 4005941032010-11-16 19:32:17 4005941952010-11-16 19:33:29 4005942842010-11-16 19:34:32

[SQL] concatenate question

2010-12-07 Thread Tony Capobianco
Here's my table: plsql_dw=# \d tmpsv_parent_master Table "staging.tmpsv_parent_master" Column |Type | Modifiers +-+--- memberid | numeric