Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order. - Mailing list pgsql-sql

From Tom Lane
Subject Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Date
Msg-id 21082.1454994009@sss.pgh.pa.us
Whole thread Raw
In response to Question on PostgreSQL DB behavior w.r.t JOIN and sort order.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
Responses Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
List pgsql-sql
"Venkatesan, Sekhar" <sekhar.venkatesan@emc.com> writes:
> I am seeing this behavior change in postgreSQL DB when compared to SQL Server DB when JOIN is performed. The sort
orderis not retained when JOIN is performed in PostgreSQL DB.
 

What sort order?  You did not specify any ORDER BY clause, so the DBMS is
entitled to return rows in any order it feels like.

I do not know anything about this "top 10" modifier you've got in the
SQL Server version, but I suspect it's implying a sort order.  In
Postgres, if you want a specific row ordering, you need to say ORDER BY.
        regards, tom lane



pgsql-sql by date:

Previous
From: "Venkatesan, Sekhar"
Date:
Subject: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Next
From: "Venkatesan, Sekhar"
Date:
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.