Can anyone help me the below query is working fine in DB Browser but not work with the Room
database. Here are the table and query:
Table Transaction
:
id | amount | is_credit |
---|
Query:
SELECT *
FROM
(SELECT
id, amount,
SUM(CASE WHEN is_credit = 1 THEN amount ELSE -amount END) OVER (ORDER BY id) AS balance
FROM `Transaction`)
ORDER BY
id DESC;
I have tried this query with SimpleSQLiteQuery
but I'm getting error :
E/SQLiteLog: (1) near "(": syntax error