Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1QEakx81940 for ; Mon, 26 Feb 2001 09:36:46 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1PLTax37407 for ; Sun, 25 Feb 2001 16:29:36 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f1PL2Kh13340 for pgsql-sql@postgresql.org; Sun, 25 Feb 2001 16:02:20 -0500 (EST) (envelope-from news) From: lotus118@excite.com (Lotus118) X-Newsgroups: comp.databases.postgresql.sql Subject: distinct date problem Date: Sun, 25 Feb 2001 21:02:18 +0000 (UTC) Organization: Delft University of Technology Lines: 21 Message-ID: <9053EEF2Alotus118excitecom@130.161.180.32> X-Complaints-To: usenet@news.tudelft.nl User-Agent: Xnews/03.09.22 To: pgsql-sql@postgresql.org X-Archive-Number: 200102/397 X-Sequence-Number: 1602 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