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