[SQL] CROSS JOIN ordering

2011-05-11 Thread Grzegorz Szpetkowski
I am curious what is proper ordering for cross joining and joining at all for two tables. I look at the example at http://www.postgresql.org/docs/9.0/static/queries-table-expressions.html and there is: SELECT * FROM t1 CROSS JOIN t2; num | name | num | value -+--+-+--- 1 | a

Re: [SQL] replace " with nothing

2011-05-11 Thread Leif Biberg Kristensen
On Wednesday 11 May 2011 23:25:34 Ross J. Reedstrom wrote: > On Wed, May 11, 2011 at 11:11:07PM +0200, Leif Biberg Kristensen wrote: > > although it's a little above me why you would want to select firstname in > > the first place when you proceed to replace it with nothing. > > Nah, he's replacin

Re: [SQL] replace " with nothing

2011-05-11 Thread Ross J. Reedstrom
On Wed, May 11, 2011 at 11:11:07PM +0200, Leif Biberg Kristensen wrote: > > although it's a little above me why you would want to select firstname in the > first place when you proceed to replace it with nothing. Nah, he's replacing double-quote-character " with nothing. An attempt to protect a

Re: [SQL] replace " with nothing

2011-05-11 Thread Ross J. Reedstrom
On Wed, May 11, 2011 at 04:51:05PM -0400, Tony Capobianco wrote: > Ok, I think I found it: > > select translate(firstname,'"','') from members; > > gives me what I want. Yup, you beat me to the answer. For the archives, if this was a compatability question (for example, you've got framework code

Re: [SQL] replace " with nothing

2011-05-11 Thread Leif Biberg Kristensen
On Wednesday 11 May 2011 22:29:40 Tony Capobianco wrote: > We are converting from Oracle to Postgres. An Oracle script contains > this line: > > select replace(firstname,'"'), memberid, emailaddress from members; > > in an effort to replace the " with nothing. How can I achieve the same > resu

Re: [SQL] replace " with nothing

2011-05-11 Thread Tony Capobianco
Ok, I think I found it: select translate(firstname,'"','') from members; gives me what I want. Thanks. On Wed, 2011-05-11 at 16:29 -0400, Tony Capobianco wrote: > We are converting from Oracle to Postgres. An Oracle script contains > this line: > > select replace(firstname,'"'), memberid, em

[SQL] replace " with nothing

2011-05-11 Thread Tony Capobianco
We are converting from Oracle to Postgres. An Oracle script contains this line: select replace(firstname,'"'), memberid, emailaddress from members; in an effort to replace the " with nothing. How can I achieve the same result with Postgres? Here's the Postgres error I get: select replace(fir