Re: sort question

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Glenn Holmer <gholmer(at)weycogroup(dot)com>, Postgres JDBC list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: sort question
Date: 2003-12-16 18:00:25
Message-ID: 200312161900.25944.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Glenn Holmer wrote:
> I don't know if this is a JDBC thing or not,

It is not.

> select distinct style, color, width, size from skiddata
> where skidno = 'F3932' order by style, color, width, size;
>
> I get the sizes in order '10 ', '10-', '11 ', '12 ', ' 9 ',
> ' 9-'. Shouldn't ' 9 ' and ' 9-' come first? Have I got
> something set up wrong in Postgres?

Text fields are sorted textually. If you want a numeric sort, use a
numeric data type.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jason L. van Brackel 2003-12-16 18:12:23 Insert Row to ResultSet problem....java.sql.SQLException: No Primary Keys
Previous Message Dave Cramer 2003-12-16 17:41:41 Re: sort question