Skip site navigation (1) Skip section navigation (2)

Re: Sorting Tuples

From: Manolo <manolo(dot)espa(at)gmail(dot)com>
To: Brian Hurt <bhurt(at)janestcapital(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Sorting Tuples
Date: 2008-03-13 13:52:36
Message-ID: 1205416356.7680.36.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-novice
Hi Brian.

That's what actually I was trying to build in order to get it.

I was thinking about 2 nested query. The inner one just sorting the output, something like:

SELECT * FROM huge_table ORDER BY a_column_of_huge_table ASC

The outer would compare for example the current tuple with the following one and as you said
 "If it finds an index such that a[i] > a[i+1], you know the result isn't sorted correctly."

Could you please write to me a sort of "what should that nested query be", please?
Remark I'm not a database user and SQL is not that fresh to me.

Thank you Brian!

> My advice would be to write a quick application that creates a cursor of 
> the sorted results, and sucks them out.  If it finds an index such that 
> a[i] > a[i+1], you know the result isn't sorted correctly.
> 
> Brian


In response to

pgsql-novice by date

Next:From: Jonah H. HarrisDate: 2008-03-13 15:11:32
Subject: Re: Sorting Tuples
Previous:From: ManoloDate: 2008-03-13 13:40:01
Subject: Re: Sorting Tuples

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group