Received: from cortex.unice.fr (cortex.unice.fr [134.59.53.1]) by hub.org (8.10.1/8.10.1) with ESMTP id e65ClCS96253 for ; Wed, 5 Jul 2000 08:47:12 -0400 (EDT) Received: from localhost (jerome@localhost) by cortex.unice.fr (8.8.5/8.8.5) with SMTP id OAA22817; Wed, 5 Jul 2000 14:46:51 +0200 Date: Wed, 5 Jul 2000 14:46:51 +0200 (MET DST) From: Jerome Alet To: Antti Linno cc: pgsql-sql@postgresql.org Subject: Re: GROUP by finish&&last day of month In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200007/38 On Wed, 5 Jul 2000, Antti Linno wrote: > New question, how to get the last day of month(order data by last day of > month). I'm sorry but I don't understand how you could order something by a value (last day of month). you can only order things by a field (e.g. a date field) or fields, in increasing or decreasing order. e.g.: you can do: SELECT id,eventdate FROM mytable ORDER BY eventdate DESC; and not: SELECT id,eventdate FROM mytable ORDER BY '2000-01-31' DESC; the latter one doesn't mean anything to me, nor to SQL I suppose. bye, Jerome ALET - alet@unice.fr - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE