Re: SQL Query

Поиск
Список
Период
Сортировка
От Trinath Somanchi
Тема Re: SQL Query
Дата
Msg-id 20071213130244.090cb587@1mc110.intotoind.com
обсуждение исходный текст
Ответ на SQL Query  (Ashish Karalkar <ashish_postgre@yahoo.co.in>)
Ответы Re: SQL Query  ("Ranbeer Makin" <ranbeer@gmail.com>)
Список pgsql-general
Hi ,

Try this out

SELECT count(o.id)
FROM   output_table o , parent_table p
WHERE  o.pid=p.pid AND o_date < now()
GROUP BY p.pid ;


On Thu, 13 Dec 2007 10:00:56 +0000 (GMT)
Ashish Karalkar <ashish_postgre@yahoo.co.in> wrote:

> 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...
>
>
> ---------------------------------
>  Forgot the famous last words? Access your message archive online.
> Click here.

--
Trinath Somanchi ,
(trinaths@intoto.com),

********************************************************************************
This email message (including any attachments) is for the sole use of the intended recipient(s)
and may contain confidential, proprietary and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended recipient,
please immediately notify the sender by reply email and destroy all copies of the original message.
Thank you.

Intoto Inc.


В списке pgsql-general по дате отправления:

Предыдущее
От: "f.zamboni@mastertraining"
Дата:
Сообщение: accessing multiple databases using dblink
Следующее
От: "John D. Burger"
Дата:
Сообщение: Re: Better alternative for Primary Key then serial??