Re: [SQL] Add calculated fields from one table to other table

2006-10-30 Thread roopa perumalraja
Hi Richard,   Thanks for your help. That does make sense, but I am not able to get the result what I wanted exactly. Let me explain you.   I have ticks table in which I have columns like ric, tick_time, price & volume. The times table has just one column with times_time which has time data for

Re: [HACKERS] [SQL] Case Preservation disregarding case sensitivity?

2006-10-30 Thread Tom Lane
"Chuck McDevitt" <[EMAIL PROTECTED]> writes: > At Teradata, we certainly interpreted the spec to allow case-preserving, > but case-insensitive, identifiers. Really? As I see it, the controlling parts of the SQL spec are (SQL99 sec 5.2) 26) A and a are equivalent if the of

Re: [SQL] Add calculated fields from one table to other table

2006-10-30 Thread Moiz Kothari
Roopa,Why dont you try putting in some case or decode with your first field, so incase if nothing is returned you explicitly make it 'A' kinds. Regards,Moiz Kothari On 10/31/06, roopa perumalraja <[EMAIL PROTECTED]> wrote: Hi   Thanks a lot for your help. The query which you suggested gives me a

Re: [SQL] Add calculated fields from one table to other table

2006-10-30 Thread Richard Broersma Jr
> select foo.ric, tm.times_time, count(tk.*), avg(tk.price), > sum(tk.price*tk.volume)/sum(tk.volume), sum(tk.volume) from (select distinct > ric from ticks) as > foo, times tm left join ticks tk on tk.tick_time >= tm.times_time and > tk.tick_time < > (tm.times_time + '1 minute' :: interval)::t

Re: [SQL] Case Preservation disregarding case sensitivity?

2006-10-30 Thread Tom Lane
beau hargis <[EMAIL PROTECTED]> writes: > Considering the differences that already exist between database systems and > their varying compliance with SQL and the various extensions that have been > created, I do not consider that the preservation of case for identifiers > would violate any SQL s

Re: [SQL] Case Preservation disregarding case sensitivity?

2006-10-30 Thread beau hargis
On Friday 27 October 2006 19:38, Joe wrote: > Hi Beau, > > On Fri, 2006-10-27 at 16:23 -0700, beau hargis wrote: > > I am hoping that there is an easy way to obtain case-preservation with > > case-insensitivity, or at the very least, case-preservation and complete > > case-sensitivity, or case-pres

Re: [SQL] Add calculated fields from one table to other table

2006-10-30 Thread roopa perumalraja
Hi   Thanks a lot for your help. The query which you suggested goes like this   select foo.ric, tm.times_time, count(tk.*), avg(tk.price), sum(tk.price*tk.volume)/sum(tk.volume), sum(tk.volume) from (select distinct ric from ticks_20060404 where ric = 'TRB') as foo, times tm left join ticks_20

Re: [SQL] Add calculated fields from one table to other table

2006-10-30 Thread roopa perumalraja
Hi   Thanks a lot for your help. The query which you suggested gives me a result like this   A  | 12:00| 12 | 64.99 | 63.99     | 12:01 | 0 | | A | 12:02 | 5 | 36.99 | 32.99   but I wanted the result to look like this  A  | 12:00| 12 | 64.99 | 63.99 A | 12:01 | 0 | | A | 12:02 | 5 |