Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7E542475FB5 for ; Thu, 24 Oct 2002 07:14:39 -0400 (EDT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 38875475E8A for ; Thu, 24 Oct 2002 07:14:38 -0400 (EDT) Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.11.6/8.11.6) with ESMTP id g9OBSYZ16186; Thu, 24 Oct 2002 14:28:34 +0300 Date: Thu, 24 Oct 2002 14:28:33 +0300 (EEST) From: Achilleus Mantzios To: andres javier garcia garcia Cc: PostgreSQL List Subject: Re: ORDER the result of a query by date In-Reply-To: <200210241054.g9OAs9c15358@natura.cebas.csic.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/334 X-Sequence-Number: 10051 On Thu, 24 Oct 2002, andres javier garcia garcia wrote: > Hello; > I've got the result of a query that appears as: > cod_variable | cod_station | year | month | day | rain > ---------------------+-------------------+--------+----------+------+------ > 30201 | 7237 | 1953 | 1 | 1 | 2 > 30201 | 7237 | 1953 | 2 | 1 | 5 > 30201 | 7237 | 1953 | 3 | 1 | 0 > 30201 | 7237 | 1953 | 4 | 1 | -3 > ..... > > (Of course, thanks to Stephan Szabo for the method to obtain this from my > strange source data. I didn't think this was possible.) > > After have done this query I've realized that I need the data to be ordered > by date. Do you have any suggestion? select ,year,month,day from order by year,month,day. Also take a look at date,timestamp data types. Note that you can process your initial "strange" source using tools as awk,perl,sh,C programs to format your datasets in sql insert statements or copy format. > > Best regards > ---------- > Javier > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-10-8981112 fax: +30-10-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr