pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lotus118@excite.com
To: pgsql-sql@postgresql.org
Subject: distinct date problem
Date: Sun, 25 Feb 2001 21:02:18 +0000 (UTC)
Message-ID: <9053EEF2Alotus118excitecom@130.161.180.32> (raw)

Hi,
I'm having difficulty figuring this one out:
I have a table with record entries which all have a date attribute, looking 
something like '2000-11-11'.  What I want from my data base is a list of 
all the years that are present in this attribute in the relation.  So for 
example, if I had a couple of records like:
2000-11-05
1988-02-09
1999-10-06
2001-08-08
1999-09-27
2001-04-04
I would want the query to return:
2000-11-05
1988-02-09
1999-10-06
2001-08-08
So that I get only the distict years.
How does one go about this?
Thanks,
Lotus



view thread (2+ messages)  latest in thread

Message-ID: <9053EEF2Alotus118excitecom@130.161.180.32>
Permalink:  ../9053EEF2Alotus118excitecom@130.161.180.32/
Also on:    postgresql.org/message-id/9053EEF2Alotus118excitecom@130.161.180.32

 · 

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: lotus118@excite.com
  Subject: Re: distinct date problem
  In-Reply-To: <9053EEF2Alotus118excitecom@130.161.180.32>
  References: <9053EEF2Alotus118excitecom@130.161.180.32>

* 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