Re: [GENERAL] Using column aliasses in the same query

2011-04-20 Thread Tore Halvorsen
On Wed, Apr 20, 2011 at 12:13 AM, Andrej wrote: > That's an accurate observation, but has nothing to do w/ what > the original poster was looking for, nor does it refute Toms > argument against the OPs suggestion. You're right, I jumped in without thinking enough.Sorry. I had just written some q

Re: [GENERAL] Using column aliasses in the same query

2011-04-19 Thread Andrej
On 18 April 2011 22:06, Tore Halvorsen wrote: > Well, refering to the computed value may be nonsensical, but > couldn't it be some sort of query rewrite? So that... > >    SELECT x/y AS z FROM tab WHERE y <> 0 AND z > 2 > > ... is a shorthand for > >    SELECT x/y AS z FROM tab WHERE y <> 0 AND x

Re: [GENERAL] Using column aliasses in the same query

2011-04-18 Thread Tore Halvorsen
On Sun, Apr 17, 2011 at 6:00 PM, Tom Lane wrote: > Yes, we've heard that before.  Many times.  It's not going to happen, > and here's why: it's flat out contrary to the SQL specification, as well > as to the basic intuitive semantics of SQL.  The SELECT list is supposed > to be evaluated as the la

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread Tom Lane
"Robert J.C. Ivens" writes: > I am not sure if there ever was a feature request for using defined > column aliases in the rest of a query. Yes, we've heard that before. Many times. It's not going to happen, and here's why: it's flat out contrary to the SQL specification, as well as to the basi

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread Robert J.C. Ivens
On 17 apr 2011, at 13:43, pasman pasmański wrote: > Maybe you think about WITH queries? > > 2011/4/17, Robert J.C. Ivens : >> >> On 17 apr 2011, at 13:21, Leif Biberg Kristensen wrote: >> >>> On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: Hi, I am not sure if there e

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread pasman pasmański
Maybe you think about WITH queries? 2011/4/17, Robert J.C. Ivens : > > On 17 apr 2011, at 13:21, Leif Biberg Kristensen wrote: > >> On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: >>> Hi, >>> >>> I am not sure if there ever was a feature request for using defined >>> column >>> aliases i

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread Cédric Villemain
2011/4/17 Robert J.C. Ivens : > > On 17 apr 2011, at 13:21, Leif Biberg Kristensen wrote: > >> On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: >>> Hi, >>> >>> I am not sure if there ever was a feature request for using defined column >>> aliases in the rest of a query. This would make que

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread Robert J.C. Ivens
On 17 apr 2011, at 13:21, Leif Biberg Kristensen wrote: > On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: >> Hi, >> >> I am not sure if there ever was a feature request for using defined column >> aliases in the rest of a query. This would make queries with a lot of >> logic in those a

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread Leif Biberg Kristensen
On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: > Hi, > > I am not sure if there ever was a feature request for using defined column > aliases in the rest of a query. This would make queries with a lot of > logic in those aliased columns a lot smaller and this easier to > write/debug. >

[GENERAL] Using column aliasses in the same query

2011-04-17 Thread Robert J.C. Ivens
Hi, I am not sure if there ever was a feature request for using defined column aliases in the rest of a query. This would make queries with a lot of logic in those aliased columns a lot smaller and this easier to write/debug. I already know you can use the following syntax: SELECT col1, col2,