Принимая int в качестве входа в python: мы берем простой строковый ввод, используя:
input()
теперь мы хотим int как input.so мы выводим эту строку в int. просто используя:
int(input())
SELECT budget_id,
SUM(IF(type = 'allocation', points, 0)) AS allocated,
SUM(IF(type = 'issue', points, 0)) AS issued
FROM transactions
GROUP BY budget_id
select budget_ID,
sum(case when type = 'allocated' then points else 0 end) as allocated,
sum(case when type = 'issued' then points else 0 end) as issued
..rest of your query...
group by budget_ID
Случаи могут использоваться для суммирования только при выполнении определенных критериев.