Re: Add calculated fields from one table to other table

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: roopa perumalraja <roopabenzer(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Add calculated fields from one table to other table
Date: 2006-11-01 05:51:12
Message-ID: 50323.50500.qm@web31808.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Hi Richard,
>
> Thanks a lot. I still am not able to get the result for all the rics in the ticks table but I
> am able to get the result for a particular ric.
>
> Can you help me with getting the result for all the rics in the ticks table
>
> Thanks
> Roopa

Could you send create table statements for the tables you are working on, and a few insert
statements for each table to have sample data. then show what you want the query results to look
like.

But from what you stated in your previous emails here is what I gather: maybe it might work?

select tk.ric as ric,
tm.times_time as minute, --timestamps by minutes
count(tk.*) as ,
...
from times tm
left join ticks tk
on (tm.times_time = date_trunc('minutes', tk.time))
group by ric, minute
order by minute;

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-11-01 06:38:25 Re: [HACKERS] Case Preservation disregarding case
Previous Message roopa perumalraja 2006-11-01 03:54:40 Re: Add calculated fields from one table to other table