Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: View to view SQL
just covered this with a colleage...
select
ename
, job , hiredate , emp.deptno , sal , ttl_sals
emp
, (
select deptno, sum(sal) as ttl_sals from emp group by deptno ) empsals
emp.deptno = empsals.deptno
-- Mark C. Stock email mcstock -> enquery(dot)com www.enquery.com (888) 512-2048 "Randy Harris" <randy_at_SpamFree.com> wrote in message news:9nzob.6741$P%1.5602532_at_newssvr28.news.prodigy.com...Received on Fri Oct 31 2003 - 14:29:30 CST
> I'm not very good with SQL and would appreciate some advice.
>
> I have a view in 8.1.7.4 that retrieves nearly a hundred fields from five
> different tables. It's long but simple and straightforward, and has been
> working quite well for some time. I've just been told that I now need to
> also retrieve some SUMs and COUNTs from fields in another table. Rather
> than modifying this view with 100 Group BYs, I wonder if it is feasible to
> create another view that gets the SUMs and COUNTs and then add that view's
> output fields to this view's? Is that a smart way to approach this
problem?
> Is there a better?
>
> Thanks in advance,
> Randy Harris
>
>
![]() |
![]() |