SELECT `c`.`client`, IFNULL(`d`.`sum`, 0)
FROM (
SELECT `client`,
SUM(`balance` * IF(`currency` = 'USD', :usd, IF(`currency` = 'EUR', :eur, 1))) AS `sum`
FROM `Dep`
GROUP BY `client`
) AS `d`
RIGHT JOIN `Contact` AS `c` ON `c`.`client_id` = `d`.`client`