Re: ORDER BY <field not in return list>

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: "Jeffrey W(dot) Baker" <jwbaker(at)acm(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ORDER BY <field not in return list>
Date: 2005-07-25 22:08:10
Message-ID: 20050725190658.F54567@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 25 Jul 2005, Jeffrey W. Baker wrote:

> On Mon, 2005-07-25 at 18:11 -0300, Marc G. Fournier wrote:
>> Just curious as to whether or not a warning or something should be issued
>> in a case like:
>>
>> SELECT c.*
>> FROM company c, company_summary cs
>> WHERE c.id = cs.id
>> AND cs.detail = 'test'
>> ORDER BY cs.fullname;
>
> Seems like it should work. Is it not returning in fullname order in
> your tests?

Full name isn't a field in the results, so how would it be ORDERing based
on it? fullname is a field in the table being joined in order to restrict
the results to just those with cs.detail = 'test' ... but company itself
doesn't have a field fullname ...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-07-25 22:10:45 Re: ORDER BY <field not in return list>
Previous Message Jim C. Nasby 2005-07-25 22:07:53 Re: More buildfarm stuff