pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jose' Soares Da Silva <sferac@bo.nettuno.it>
To: Tim J Trowbridge <trowbrid@writeme.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Order by birthdate
Date: Thu, 11 Jun 1998 10:52:59 +0000 (UTC)
Message-ID: <Pine.LNX.3.96.980611104627.2637C-100000@proxy> (raw)
In-Reply-To: <357F4370.5BB8@writeme.com>

On Wed, 10 Jun 1998, Tim J Trowbridge wrote:

> I'm trying to generate a birthday list ordered by month, then by day. 
> This is what I thought would work...
> 
> SELECT name,birthdate FROM table WHERE birthdate is not null ORDER BY
> date_part('month',birthdate)

I don't understand why you need specify month to sort tuples, you may order
it by birthday, but if you want it anyway try this:

SELECT name, EXTRACT(month FROM birthdate) AS mese
      FROM table WHERE birthdate is not null
      ORDER BY mese
> 
> but psql returns:
> 
> ERROR:  parser: parse error at or near "("
> 
> What's the problem?
Seems that order by doesn't supports a function as parameter.
                                  Jose'




view thread (3+ messages)

Message-ID: <Pine.LNX.3.96.980611104627.2637C-100000@proxy>
Permalink:  ../Pine.LNX.3.96.980611104627.2637C-100000@proxy/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.980611104627.2637C-100000@proxy

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: sferac@bo.nettuno.it, trowbrid@writeme.com
  Subject: Re: [SQL] Order by birthdate
  In-Reply-To: <Pine.LNX.3.96.980611104627.2637C-100000@proxy>
  References: <357F4370.5BB8@writeme.com> <Pine.LNX.3.96.980611104627.2637C-100000@proxy>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox