I have 2 table like this:
Table_Work
Name Date
===============
Andy 1 Jan
Andy 2 Jan
Andy 3 Jan
Ana 1 Jan
Ana 2 Jan
Ana 3 Jan
Ana 4 Jan
and Table_Salary
Name Salary
=================
Andy 150
Ana 120
I want to use column Name and Salary from table_salary as a parameter. So, I can show a data like this:
Name Salary_Got
===================
Andy 300
Ana 360
Table above show Salary_Got that calculate by (Salary x Number of Work). But I show only where work from 2 Jan. So, Andy only work for 2 days and Ana for 3 days.
Note: This is only illustrated problem. My problem more complex than this. The point is I cannot use JOIN because I need to calculate other row.
I hope anyone can help me to solve this problem. Thanks in advance.