Re: create view performance problem
From: Robin Rosenberg <robin_at_rosenbergit.se>
Date: Sun, 02 May 1999 20:26:37 GMT
Message-ID: <372CB516.38492CCC_at_rosenbergit.se>
Date: Sun, 02 May 1999 20:26:37 GMT
Message-ID: <372CB516.38492CCC_at_rosenbergit.se>
vagelis Hristidis wrote:
> I have a table with columns :symbol, st_date,value
> and I would like to create a view with columns:
> symbol,st_date_for_max_value,max_value
> where there is one row for each stock symbol.
> How can I do it so that it performs well?
> The problem is that sql won't let me use st_date in select clause when i
> don't also put it in group by clause.If I use a pl/sql function it's slow.
> Thanks in advance.
>
> vagelis
Why don't you want a group by? That is simply the way to solve this type of
problem.
Besides you'll want some kind of index to make this fast, probably on all
involved columns.
-- Robin Rosenberg | Voice: +46-708-305342 | "Any opinions are my own, etc. etc."3 Copyright © 1999 | ICQ#: 4058565 | <this line left blank> Rosenberg IT AB | Mail: robinr_at_acm.org |Received on Sun May 02 1999 - 22:26:37 CEST