When you have 2 separate questions, post 2 separate threads.
Q1 sounds like a job for the aggregate SUM function.
To get a separate total for each calendar day, you can use TRUNC (trade_time) in the GROUP BY clause. (When dt is a DATE, TRUNC r(dt) returns the same time, namely midnight, on that calendar day, regardless of what the hours, minutes and seconds of dt are.)
To see only the days with a positive sum, use a HAVING clause.
Again, start a separate thread for Q2. (You may want to wait until you have solved Q1.)
Whenver you have a question, post your best attempt at solving the problem, along with a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 220.127.116.11.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
As Frank said, please post CREATE and INSERT table scripts, the required output and the solution which you have tried to solve your requirement. Please do mention your Oracle version. I am posting the query for the first requirement. Try it.
WITH t1 AS
(SELECT 1 ID,
TO_DATE('06/16/2013 11:43','MM/DD/YYYY HH24:MI') TRADE_TIME,
SELECT 2, TO_DATE('06/16/2013 11:50','MM/DD/YYYY HH24:MI'), 142.74 FROM DUAL
SELECT 3, TO_DATE('06/16/2013 14:21','MM/DD/YYYY HH24:MI'), -43.89 FROM DUAL
SELECT 4, TO_DATE('06/17/2013 12:50','MM/DD/YYYY HH24:MI'), 36.85 FROM DUAL
SELECT 5, TO_DATE('06/17/2013 13:40','MM/DD/YYYY HH24:MI'), -523.58 FROM DUAL
SELECT TO_CHAR(TRUNC(trade_time),'DD-MON-YYYY') DAY,
GROUP BY TO_CHAR(TRUNC(trade_time),'DD-MON-YYYY');
Do post your required scripts for the second question. Do not forget to mention the solution you could come up with. Then we will let you know on how to improve your solution.
Looks Like the OP usually ask the question and don't check the thread for few days ,
Coming back after few days they don't find the thread which they started .
So they started asking the same question again with a new thread.
For those -My advice is to
1. Login to the forum with your credential .
2. Click on your profile.
3.Click on the Activity Tab of your profile.
Now you will find your thread easily.