This is SQL, so conditions must be in WHERE, not GROUP BY. Furthermore your examples have amount, not opening_balance.
using sign keyword or select case with orientdb to group by positive and negative
-
17-07-2023 - |
Frage
Hi I'm trying to do a queries like the ones below in Orientdb
select sum(opening_balance) from account group by opening_balance < 0
select count(opening_balance) from account group by opening_balance < 0
they run but I'm not getting the desired results in both cases it splits the return by the opening_balance value not whether it is negative or positive.
This is on a graph database
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow