Re: Query ordering question - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Query ordering question
Date
Msg-id 9C942DB6-AE24-4326-BB2F-5FA0DE977565@gmail.com
Whole thread Raw
In response to Query ordering question  (ajmcello <ajmcello78@gmail.com>)
List pgsql-general
On 3 Jul 2012, at 1:22, ajmcello wrote:

> db=# SELECT name,date,percent,price,time,amount FROM name WHERE amount >= '1000000' AND date='$today' ORDER BY
percentDESC; 
>
> name |    date     | percent        |  price  |   time   |  amount
> --------+------------+----------------+---------+----------+----------
> BOB   | 2012-07-02 |          63.77 |    8.86 | 14:59:00 | 26975372
> BOB   | 2012-07-02 |          63.77 |    8.86 | 15:01:00 | 27001372
> BOB   | 2012-07-02 |          64.06 |  8.8755 | 15:04:00 | 27145552
> BOB   | 2012-07-02 |          63.77 |    8.86 | 14:57:00 | 26946338
> GIL   | 2012-07-02 |          38.72 |  0.6789 | 14:55:00 |  1012880

This output makes no sense with the sort order you specified.
Are you sure that the output matches the query? If it does, is percent a numeric field or is it a varchar where the
numbershave varying amount of leading space perhaps? 

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.


pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Query ordering question
Next
From: Pawel Veselov
Date:
Subject: errors with high connections rate