salix/print/templates/email/invoice/sql/invoice.sql

7 lines
154 B
SQL

SELECT
io.ref,
t.id AS ticketFk
FROM invoiceOut io
JOIN ticket t ON t.refFk = io.ref
JOIN client c ON c.id = io.clientFk
WHERE t.refFk = ?