using sign keyword or select case with orientdb to group by positive and negative

StackOverflow https://stackoverflow.com/questions/23526140

  •  17-07-2023
  •  | 
  •  

문제

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

도움이 되었습니까?

해결책

This is SQL, so conditions must be in WHERE, not GROUP BY. Furthermore your examples have amount, not opening_balance.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top