1 2 3
| SELECT CONCAT( "nom_titre" ) AS "Titre", CONCAT( CONCAT( "nom_personne", ' ' ), "prenom_personne" ) AS "Personne", CONCAT( CONCAT( "nom_rue_personne", ' ' ), "num_rue_personne" ) AS "Adresse", CONCAT( CONCAT( "cp_localite", ' ' ), "nom_localite" ) AS "Localité" FROM "ti_personne_chien", "t_personne", "t_localite", "t_titre" WHERE "ti_personne_chien"."xid_personne" = "t_personne"."id_personne" AND "t_personne"."xlocalite_personne" = "t_localite"."id_localite" AND "t_personne"."xtitre_personne" = "t_titre"."id_titre" AND "ti_personne_chien"."date_adoption" BETWEEN {D '2012-11-28' } AND {D '2013-11-28' } GROUP BY "t_personne"."id_personne", CONCAT( CONCAT( "nom_personne", ' ' ), "prenom_personne" )
UNION
SELECT CONCAT( "nom_titre" ) AS "Titre", CONCAT( CONCAT( "nom_personne", ' ' ), "prenom_personne" ) AS "Personne", CONCAT( CONCAT( "nom_rue_personne", ' ' ), "num_rue_personne" ) AS "Adresse", CONCAT( CONCAT( "cp_localite", ' ' ), "nom_localite" ) AS "Localité" FROM "ti_personne_paiement", "t_personne", "t_localite", "t_titre" WHERE "ti_personne_paiement"."xid_personne" = "t_personne"."id_personne" AND "t_personne"."xlocalite_personne" = "t_localite"."id_localite" AND "t_personne"."xtitre_personne" = "t_titre"."id_titre" AND "ti_personne_paiement"."date_paiement" BETWEEN {D '2012-11-28' } AND {D '2013-11-28' } GROUP BY "t_personne"."id_personne", CONCAT( CONCAT( "nom_personne", ' ' ), "prenom_personne" ) HAVING ( ( SUM( "ti_personne_paiement"."montant_paiement" ) >= 25 ) ) |
Partager