Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0854B47591A for ; Tue, 14 May 2002 07:58:30 -0400 (EDT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 205214758F8 for ; Tue, 14 May 2002 07:58:28 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue May 14 13:58:24 2002 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id NAA19590; Tue, 14 May 2002 13:58:24 +0200 (METDST) From: Christoph Haller Message-Id: <200205141158.NAA00136@rodos> Subject: Re: order by To: mat@mat.cc (Mathieu Arnold) Date: Tue, 14 May 2002 13:58:23 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: <1713675304.1021384181@andromede.reaumur.absolight.net>; from "Mathieu Arnold" at May 14, 102 1:48 pm X-Mailer: Elm [revision: 212.4] X-Archive-Number: 200205/129 X-Sequence-Number: 7765 Try select * from a order by 3,1,2; Regards, Christoph > > Hi > > I have : > > table a (int, varchar, int) > > 1 | one | 1 > 2 | two | 3 > 3 | three | 2 > 4 | four | 3 > 5 | five | 2 > > And I would like to select it and sort it so that the 3rd field is first 2, > then 1 and then 3. so that the result should be : > > 1 | one | 1 > 3 | three | 2 > 5 | five | 2 > 2 | two | 3 > 4 | four | 3 > > How could I do that ? > > -- > Mathieu Arnold > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >