我们想将以下MySQL查询转换为Slick。可能吗?我无法找到SET
或"运行总计"的示例任何地方。
从oldtransactions
中选择一些元素,然后添加一个包含总计的余额列。从结果中,按交易ID选择特定交易,并在该点显示余额。
SET @runtot =0;
SELECT balance
FROM (SELECT clno,
acno1,
( @runtot := @runtot + r.amount ) AS balance
FROM (SELECT *
FROM oldtransactions
WHERE ( acno1 = ''
OR acno2 = '' )) AS t
ORDER BY trtime ASC) AS final
WHERE tt_id = '123'