Re: Bug, feature, quirk? HELP

From: "Len Morgan" <len-morgan(at)crcom(dot)net>
To: "Stoppel, Brett W" <bstoppel(at)ku(dot)edu>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug, feature, quirk? HELP
Date: 2001-04-15 13:43:02
Message-ID: 002501c0c5b1$ff37bca0$0908a8c0@H233.bstx.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>I tried the following command
>
>db=> SELECT DISTINCT name, city FROM table ORDER BY trim(table.name);
>ERROR: For SELECT DISTINCT, ORDER BY expressions must appear in target
list

Try:

SELECT DISTINCT trim(name) AS name,city FROM table ORDER BY name ;

And if that doesn't work:

SELECT DISTINCT trim(name),city FROM table ORDER BY trim(name) ;

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-04-15 13:48:29 Re: Bug, feature, quirk? HELP
Previous Message Nils Zonneveld 2001-04-15 13:35:54 Changes in PostgreSQL 7.1