I try to do a quite difficult sql select statement. Any hints are well appreciated :). Links etc. Here are my tables:

```
tbl_user
id     f_name       l_name    hourly_rate
1      Tom          Riddle    25
2      Frank        Smith     30
3      Lupin        Moon      35

tbl_entries
id     s_time   e_time   fk_user   fk_bank
1      08:00    10:00    1         1
2      11:05    11:50    1         2
3      12:00    18:00    2         1
4      13:00    15:00    2         1
5      10:00    12:00    3         2

tbl_bank
id     bank
1      a
2      b

```

I'd like to select and group them by tbl\_bank. So my expected output should be:

```
id (tbl_user)     f_name     l_name       bank      total time (difference)   wage
1                 Tom        Riddle       a         02:00                     50
1                 Tom        Riddle       b         00:45                     18.75  
2                 Frank      Smith        a         08:00                     240
3                 Lupin      Moon         b         02:00                     70

```

I have something like this

```
SELECT
    id,
    f_name,
    l_name,
    hourly_rate
FROM
    tbl_user
    INNER JOIN tbl_entries ON tbl_user.id         = tbl_entries.fk_user
    INNER JOIN tbl_bank    ON tbl_entries.fk_bank = tbl_bank.id

```

which gives me all values but is obviously not grouped and without total time and .