Mihael
05/25/2019, 8:29 PMsql
```SELECT A.script_name, A.count, (A.count * 100) / totalCount AS percentage, totalCount
FROM (SELECT script_name, COUNT(*) AS count FROM sessions WHERE client_username = "Miha" GROUP BY script_name) AS A
INNER JOIN (SELECT COUNT(*) AS totalCount FROM sessions WHERE client_username = "Miha") AS B
GROUP BY A.script_name
```
Can anyone help me write this in Exposed kotlin?
I’ve tried using aliases but was never able to select totalCount from a subquery or the main query.tapac
05/29/2019, 12:29 PMMihael
05/29/2019, 10:28 PM