Sorting based on maximum value over several columns - Mailing list pgsql-general

From Net Virtual Mailing Lists
Subject Sorting based on maximum value over several columns
Date
Msg-id 20041107003159.11646@mail.net-virtual.com
Whole thread Raw
Responses Re: Sorting based on maximum value over several columns
List pgsql-general
Hello,

Lets say I have data like this:


value1|value2|value3|value4|....|value(N)
------|------|------|------|----|--------
100   | 200  | 300  |  400 |    |
10    | 20   |      |  40  |    |
      | 15   |      |  16  |    |
5     |      |      |      |    |


Now I want to sort these based on the maximum value of the data in each
row, so for sorting purposes I would have this:

sort
----
400
40
16
5


Any ideas?...  I've tried several things but none of them have given me
the result I am after....


Thanks as always!

- Greg


pgsql-general by date:

Previous
From: "Uwe C. Schroeder"
Date:
Subject: Re: SQL question
Next
From: Mike Cox
Date:
Subject: Re: Postresql RFD version 2.0 Help Wanted.