I have two tables :
table1 :
acc_id acc_desc
100 cost1 1002 cost21003 cost31004 cost4 table2:
t_id t_date t_value t_fId t_tId
1 1/1/2014 90$ 100 1001 3 2/1/2014 50$ 100 1003
4 3/1/2014 50$ 1002 100
5 7/1/2014 50$ 100 10036 8/1/2014 50$ 1002 100
now ,How can I write a query so that the result of the table are as follows:t_date is between dates (7/1/2014,11/1/2014) and (t_fId =100 or t_tId=100)7 9/1/2014 150$ 100 10038 10/1/2014 200$ 1004 1008 10/1/2014 200$ 100 1004
no. date sum1 sum2 1 ....... 140& 50$ this is row before the date 7/1/2014 2 7/1/2014 50& 03 9/1/2014 150$ 04 10/1/1014 200$ 03 8/1/2014 0 200$
kapil suriPosted Feb 14, 2014, 5:43 PM