SELECT t.id, t.shipped, c.code companyCode, t.packages, tto.description, ot.code FROM ticket t JOIN company c ON c.id = t.companyFk LEFT JOIN ticketObservation tto ON tto.ticketFk = t.id LEFT JOIN observationType ot ON tto.observationTypeFk = ot.id WHERE t.id = 1;