Archives journalières: 23 février 2018

15 articles

Comment extraire les attributs lecteurs?

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 ORDER BY borrowers.surname, borrowers.firstname ASC Résultat :

Comment afficher plusieurs valeurs autorisées dans une même requête (sous-requêtes SELECT)

Exemple pour le module adhérent : SELECT borrowers.cardnumber AS numero_carte, borrowers.surname AS Nom, borrowers.firstname AS Prenom, borrowers.email AS email_principal, borrowers.emailpro AS email_alternatif, borrowers.dateenrolled AS date_inscription, borrowers.dateexpiry AS date_expiration, borrowers.categorycode AS categorie_pret, (SELECT description FROM categories WHERE categorycode=borrowers.categorycode) AS categorie, borrowers.sort1, […]