I wonder if you can use CASE
with more than 1 condition.
In this query I have calculations that need to be done when a.operacao == 'C'
but that depend on the value of a.DESCRICAO_PREMIO
( '1P'
or '1/5P'
) to define which account exactly.
SELECT
a.*,
CASE (a.operacao)
WHEN 'C' THEN (b.multiplicador * a.valor_jogo)
END AS [Valor]
FROM tb_jogo_detalhe a
INNER JOIN tb_modalidade b ON b.abreviatura = a.operacao
WHERE a.ID = 2222
How to use more than one condition in a CASE
?