pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marcel Ruff <mr@marcelruff.info>
To: pgsql-sql@postgresql.org
Subject: How change col name during query to use it in where clause
Date: Fri, 04 May 2012 12:25:45 +0200
Message-ID: <4FA3AEA9.6010401@marcelruff.info> (raw)

Hi,

is an alias name not usable in the where clause?

select EXTRACT(day from enddate::TIMESTAMP - old_enddate::TIMESTAMP) AS TAGE  from account_h  where 
TAGE>5;
ERROR:  column "tage" does not exist
LINE 1: ... TAGE>5 ...

Thank you
Marcel



view thread (4+ messages)  latest in thread

Message-ID: <4FA3AEA9.6010401@marcelruff.info>
Permalink:  ../4FA3AEA9.6010401@marcelruff.info/
Also on:    postgresql.org/message-id/4FA3AEA9.6010401@marcelruff.info

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mr@marcelruff.info
  Subject: Re: How change col name during query to use it in where clause
  In-Reply-To: <4FA3AEA9.6010401@marcelruff.info>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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