From: Vladimir Terziev <vlady@school.digsys.bg>
To: pgsql-sql@postgresql.org
Subject: Question about SELECT and ORDER BY
Date: Thu, 03 Feb 2000 16:34:31 +0200
Message-ID: <200002031434.QAA01945@lorna.digsys.bg> (raw)
Hi,
I have two tables:
table1 (attr1 text, attr2 int4)
table2 (attr1 text, attr3 int4, attr4 bool)
I have a query:
SELECT table1.attr1 AS ALIAS, attr2 from table1 UNION ALL
SELECT table2.attr1, attr3 from table2 ORDER BY ALIAS;
I that syntax all is OK.
I want to have a result from ORDER BY length(ALIAS), but this is imposible.
When ORDER BY clause is in format ORDER BY length(attr1), the result is not
ORDERED BY length of attr1.
What can I do? Are anybody have an idea?
Vladimir
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: vlady@school.digsys.bg
Subject: Re: Question about SELECT and ORDER BY
In-Reply-To: <200002031434.QAA01945@lorna.digsys.bg>
References: <200002031434.QAA01945@lorna.digsys.bg>
* 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