Hi fnds, I want to maintain the financial database of 20 users for 1 year and update the details in jsp page.. so i have decided to maintain the details based on month (because the other modules in this project needs the output based on month) .. I have created 12 tables with table name - month1,month2,....,upto month12.. each table contains the data like name,amount,paiddate and balance of individual users... i want to calculate the balance of individual users.. for eg, for the user A, let the balance at month1 is 1000... if the user A balance at month2 is 2000, i want to add those balance and display it as 3000 at jsp page for month2.. pls its urgent frnds...
Use the given query
SELECT uname, SUM(balance) as sm FROM ( SELECT * FROM month1 UNION ALL SELECT * FROM month2 UNION ALL SELECT * FROM month3 ) AS somealias GROUP BY uname;
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.