Re: upper() don't work with field-alias in the order by part

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Wjatscheslaw Wächter <waechter(at)comvos(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: upper() don't work with field-alias in the order by part
Date: 2001-09-06 19:35:37
Message-ID: Pine.BSF.4.21.0109061235120.94311-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 6 Sep 2001, Wjatscheslaw [iso-8859-1] Wchter wrote:

> I'm using PostgreSql 7.1.2 on SuSe-Linux
>
> Example:
> this works:
> select p1.prs_vorname as vorname, p1.prs_nachname as nachname,
> p1.lfdnr as lfdnr, pos.pos_name as position,
> p1.prs_email as email, abt.abt_name as abteilung
> from person p1 left join abteilung abt
> on abt.lfdnr = p1.prs_abt_lfdnr,
> person p2 left join positionen pos
> on pos.lfdnr=p2.prs_pos_lfdnr
> where p1.lfdnr=p2.lfdnr
> ORDER BY nachname;
>
> this don't work:
> select p1.prs_vorname as vorname, p1.prs_nachname as nachname,
> p1.lfdnr as lfdnr, pos.pos_name as position,
> p1.prs_email as email, abt.abt_name as abteilung
> from person p1 left join abteilung abt
> on abt.lfdnr = p1.prs_abt_lfdnr,
> person p2 left join positionen pos
> on pos.lfdnr=p2.prs_pos_lfdnr
> where p1.lfdnr=p2.lfdnr
> ORDER BY upper(nachname);
>
> ERROR: Attribute 'nachname' not found

Does upper(p1.prs_nachname) work?

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-09-06 20:29:09 Re: Logging problems in PostgreSQL 7.2devel
Previous Message Tom Lane 2001-09-06 19:24:54 Re: parse error: LIMIT combined with UNION