agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Venkatesan, Sekhar <sekhar.venkatesan@emc.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Date: Tue, 09 Feb 2016 00:00:09 -0500
Message-ID: <21082.1454994009@sss.pgh.pa.us> (raw)
In-Reply-To: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BE54@MX105CL01.corp.emc.com>
References: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BE54@MX105CL01.corp.emc.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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 order is 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
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (17+ messages) latest in thread
Message-ID: <21082.1454994009@sss.pgh.pa.us>
Permalink: ../21082.1454994009@sss.pgh.pa.us/
Also on: postgresql.org/message-id/21082.1454994009@sss.pgh.pa.us
reply
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, sekhar.venkatesan@emc.com
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
In-Reply-To: <21082.1454994009@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox