From: Richard Broersma Jr <rabroersma@yahoo.com>
To: roopa perumalraja <roopabenzer@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Add calculated fields from one table to other table
Date: Tue, 31 Oct 2006 21:51:12 -0800 (PST)
Message-ID: <50323.50500.qm@web31808.mail.mud.yahoo.com> (raw)
In-Reply-To: <20061101035440.76569.qmail@web50809.mail.yahoo.com>
> 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;
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rabroersma@yahoo.com, roopabenzer@yahoo.com
Subject: Re: Add calculated fields from one table to other table
In-Reply-To: <50323.50500.qm@web31808.mail.mud.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