I have a query that goes something like this:
SELECT SUM(`table`.points) AS total_points FROM table
This will return something like this
| **points** |
324
Now I want to add another result next to it depending on the total points that the user has and display it. Below is the sample that I am trying to achieve
if (total_points >= 50 && < 100) {
//display another column next to the points
another_rows AS total_points + 50
} else if (total_points >= 100 && < 200) {
another_rows AS total_points + 100
} else if (total_points >= 200 && < 300) {
another_rows AS total_points + 200
} else if (total_points >= 300 || 300) {
another_rows AS total_points + 300
} else {
another_rows AS total_points
}
Desire results:
| **points** | **another_row** |
324 824