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

Re: BUG #4037: Manual bug: 2.5. Querying a Table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Cristian Cruz" <danielcristian(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4037: Manual bug: 2.5. Querying a Table
Date: 2008-03-14 23:08:04
Message-ID: 27448.1205536084@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Daniel Cristian Cruz" <danielcristian(at)gmail(dot)com> writes:
> Where it says:

> "Notice how the AS clause is used to relabel the output column. (The AS
> clause is optional.)"

> It's wrong, because it causes an error if executed without it.

Hmm?  You can leave off the AS clause if you want:

SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
SELECT city, (temp_hi+temp_lo)/2, date FROM weather;

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: AlexeyDate: 2008-03-15 12:36:09
Subject: BUG #4038: Problem with locale changing by initdb
Previous:From: Daniel Cristian CruzDate: 2008-03-14 21:40:59
Subject: BUG #4037: Manual bug: 2.5. Querying a Table

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