Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to aggregate values from different rows but same user

Re: how to aggregate values from different rows but same user

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 21 Sep 2005 17:40:38 -0700
Message-ID: <1127349638.293420.200430@g49g2000cwa.googlegroups.com>


Colin, a little thinking on your part should lead you to conclude that

select * from usage where in_out = 'in' is a table of the start times select * from usage where in_out = 'out' is a table of the end times if you join these two tables on the user you have your first example I will leave the SQL syntax to you

Problem number 2
Look up the CASE statement or the DECODE function in the SQL manual or in your text book
You can use either to assign users to a bucket Sum the bucket
Again I will leave the actual SQL statement to you

HTH -- Mark D Powell -- Received on Wed Sep 21 2005 - 19:40:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US