Hi,I have the following tables:TaskTaskIDPointsUserUserIDUserFNmUserLNmLevelSubLevelIDTaskUserTaskIDUserIDStartDateOfTaskEndDateOfTaskLevelLevelIDLevelNameSubLevelSubLevelIdSubLevelNameLevelSubLevelLevelSubLevelIDLevelIDSubLevelIDRequiredPoints
The tables represent a system where a user earns points on doing a 'task' on a forum. RequiredPoints depicts the total points required to move to the next Sublevel in that Level.SampleLevelSubLevelID LevelID SubLevelID RequiredPoints1 1 1 5002 1 2 10003 1 3 15004 2 1 20005 2 2 25006 2 3 3000
and so on...In each Level there are 3 SubLevels. There are total 5 Level - Novice, Intermediate, Advanced, Admin, SuperUserI want 2 queries which will display data of the users who are eligible to move to the next sublevel or level in the following manner:1. The points collected by user and the required points to move to the next SUBLEVEL by taking a % of difference between (ReqPoints - Points) and ordering by it. Eg:UserFNm Level SubLevel Points RequiredPointsJack Novice S1 480 500Harry Novice S2 900 1000
2. All those user who are eligible to move to the next LEVEL (Users who are in SubLevel 3 in the Level 1. Now they are eligible to move to Level 2 Sublevel 1 order by the required points to move to the next Level - Current Sublevel points)How to do this?