salix/print/templates/reports/cmr-authorization/sql/ticket.sql

12 lines
323 B
MySQL
Raw Normal View History

2021-12-13 07:23:44 +00:00
SELECT
t.id,
t.clientFk,
cty.country,
w.name AS warehouse
FROM ticket t
JOIN warehouse w ON w.id = t.warehouseFk
JOIN address a ON a.id = t.addressFk
JOIN province p ON p.id = a.provinceFk
JOIN autonomy au ON au.id = p.autonomyFk
JOIN country cty ON cty.id = au.countryFk
WHERE t.id = ?