SQL Query - Mailing list pgsql-general

From Ashish Karalkar
Subject SQL Query
Date
Msg-id 591590.76564.qm@web94315.mail.in2.yahoo.com
Whole thread Raw
List pgsql-general
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.

pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Slow PITR restore
Next
From: Ashish Karalkar
Date:
Subject: SQL Query