Good day. I'm having a hard time figuring out how to do this:
SELECT P.GrossSalary, S.Contribution FROM Payroll AS P, SSSChart AS S WHERE
P.GrossSalary >= S.RangeStart AND P.GrossSalary <= S.RangeEnd;
I need the corresponding contribution amount from SSSChart table where the Gross Salary is between the Start and End range.
The problem is it will work on the first found matched record from Payroll table but the searching from the SSSChart table will not start from the top again for the next Payroll record, instead, will continue the search after the found record from the previous Payroll record. I tried several SQL commands but found no luck. All the help will be appreciated. (Doing this for my payroll system practice)