SELECT borrowers.borrowernumber, borrowers.surname, borrowers.firstname, borrowers.cardnumber, borrower_attributes.code, borrower_attributes.attribute FROM borrowers LEFT JOIN borrower_attributes ON (borrowers.borrowernumber=borrower_attributes.borrowernumber) LEFT JOIN borrower_attribute_types ON (borrower_attribute_types.code=borrower_attributes.code) GROUP BY borrower_attributes.attribute […]