pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashish Karalkar <ashish_postgre@yahoo.co.in>
To: pgsql-novice@postgresql.org
To: ashish.karalkar@netcore.co.in
Subject: SQL Query
Date: Thu, 13 Dec 2007 09:47:36 +0000 (GMT)
Message-ID: <591590.76564.qm@web94315.mail.in2.yahoo.com> (raw)

Hello List member,
I have a table which ha sfollowing structure

my_table:
(
    output_id serial priimary key,
    parent_id int,
    output_date timesatmp
)

parent_table:

(parent_id int,
parent desc
)

the my_table contains data for previous as well as future output dates.
for single parent there may be multiple rows.

I want to retrieve all the output_id  which are having latest output_date but less than now() (no future output_dates) group by  parent_id 

Thanks in advance

With Regards
Ashish...













       
---------------------------------
 Chat on a cool, new interface. No download required. Click here.

view thread (45+ messages)  latest in thread

Message-ID: <591590.76564.qm@web94315.mail.in2.yahoo.com>
Permalink:  ../591590.76564.qm@web94315.mail.in2.yahoo.com/
Also on:    postgresql.org/message-id/591590.76564.qm@web94315.mail.in2.yahoo.com

 · 

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-general@postgresql.org
  Cc: ashish_postgre@yahoo.co.in, pgsql-novice@postgresql.org, ashish.karalkar@netcore.co.in
  Subject: Re: SQL Query
  In-Reply-To: <591590.76564.qm@web94315.mail.in2.yahoo.com>
  References: <591590.76564.qm@web94315.mail.in2.yahoo.com>

* 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