MySQL: use el valor CASE / ELSE como parámetro de combinación
Estoy tratando de unir la tabla NOMBRE y FOTO de USUARIOS a la tabla TRANSACCIONES en función de quién es el pagador o el beneficiario. Sigue diciéndome que no puedo encontrar la mesathis
-- ¿Qué estoy haciendo mal?
SELECT `name`,`photo`,`amount`,`comment`,
(
CASE `payer_id`
WHEN 72823 THEN `payee_id`
ELSE `payer_id`
END
) AS `this`
FROM `transactions`
RIGHT JOIN `users` ON (`users`.`id`=`this`)
WHERE `payee_id`=72823 OR `payer_id`=72823