12 lines
379 B
MySQL
12 lines
379 B
MySQL
|
SELECT
|
||
|
c.id,
|
||
|
u.name AS userName,
|
||
|
c.email recipient,
|
||
|
CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
|
||
|
w.phone AS salesPersonPhone,
|
||
|
CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
|
||
|
FROM client c
|
||
|
JOIN account.user u ON u.id = c.id
|
||
|
LEFT JOIN worker w ON w.id = c.salesPersonFk
|
||
|
LEFT JOIN account.user wu ON wu.id = w.userFk
|
||
|
WHERE c.id = ?
|