Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with SQL-statement !
c w wrote:
> "Ole Hansen" <ohahaahr_at_hotmail.com> wrote in message > news:3d05b5c1.0503140844.6c287453_at_posting.google.com... >
> > > > Try this it might help haven't tested it, I am a newbie also. > > select date, sum(s1.qty) INFLOW, sum(s2.qty) OUTFLOW, (sum(s1.qty)) - > sum(s2.qty)) STOCKLEVEL > from(select date, qty, 0 > from Stocktrans s1 > where qty > 0 > union > select date, 0,qty > from Stocktrans s2 > where qty < 0) > group by date
When questions look like homework, or worse finals, please be sure to provide hints ... not solutions. It makes our job as instructors far more difficult.
Thanks.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Tue Mar 22 2005 - 15:07:53 CST
![]() |
![]() |