Hi All,
I am new to SQL programming, i have only a fair knowledge on sql programmin.So, I apologies for any silly questions:)-
I have a table which contains
C1-acountid
C2-date
C3-grossamount(pos tivie and negative decimal values)
C4-netamount
I need to retrieve the following on a single table
1. top 10 losers of the day i.e. 10 AccountIDs with the greatest negative Grossamount for the day
NOTE:These 10 AccountIDs may be sam or differing each day
2.sum of Netamount for each AccountIDs listed in STEP 1 since the beginning of the month.
NOTE:These 10 AccountIDs may be sam or differing each day and each day sum of netamount should be from beginning of the month till current date.
3.Sum of Netamount for the last 5 days for each accountids in STEP1
I have wirtten a script for retrieving the data for the STEP1. But how can i proceed with STEP 2 and 3.
I need all the three results in the same table
Please help me in doing it.
Thanks in advance
I am new to SQL programming, i have only a fair knowledge on sql programmin.So, I apologies for any silly questions:)-
I have a table which contains
C1-acountid
C2-date
C3-grossamount(pos tivie and negative decimal values)
C4-netamount
I need to retrieve the following on a single table
1. top 10 losers of the day i.e. 10 AccountIDs with the greatest negative Grossamount for the day
NOTE:These 10 AccountIDs may be sam or differing each day
2.sum of Netamount for each AccountIDs listed in STEP 1 since the beginning of the month.
NOTE:These 10 AccountIDs may be sam or differing each day and each day sum of netamount should be from beginning of the month till current date.
3.Sum of Netamount for the last 5 days for each accountids in STEP1
I have wirtten a script for retrieving the data for the STEP1. But how can i proceed with STEP 2 and 3.
I need all the three results in the same table
Please help me in doing it.
Thanks in advance
Comment