I want to show the summary of all values as visual date. For example:
| Key | Val1 | Val2 | Val3 |
|---|---|---|---|
| 1 | 125 | 545 | 0 |
| 2 | 0 | 467 | 0 |
Here, val1, val2 and val3 are in seconds. In SQL, they are saved as BIGINT(20).
Those values represents the time for each users doing something different. So, the user with key 1 stay 125 seconds on the page which is named val1, 545 seconds on page val2 and 0 on val3.
The objective is to know which page is the more used, where users stay lot of time. So, I want to make a readable time and convert "3600 seconds" into "1h" for example.
More exactly, I want to show as something like this:
| Val1 | Val2 | Val3 |
|---|---|---|
| 2min 05s | 16min 52s | 0s |
I tried to used something like this but it's only for sql-server.
Actually, I made this:
SELECT
FROM_UNIXTIME(SUM(val1), ' 