SELECT io.id, io.clientFk, c.email recipient, eu.email salesPersonEmail FROM invoiceOut io JOIN client c ON c.id = io.clientFk LEFT JOIN account.emailUser eu ON eu.userFk = c.salesPersonFk WHERE io.id = ?