sql - MySQL procedure - how to improve performance of query? -
i have mysql procedure collecting data 3 tables:
- dossier
- courrier
- courrier_concerne_dossier
simply can't use select * from... need every dossier_str separated (one dossier_str in each column , in 1 big result set).
(select dossier_oid data.courrier_concerne_dossier courrier_oid = param_oid limit 1) 'dossier1_oid', (select concat(a.prefixe_numero, "-", cast(a.numero char), " - ",date_format(a.date_ouverture, '%e/%c/%y'), " - ", b.nom, " - ", a.intitule) data.dossier join data.client b on a.client_oid=b.oid a.oid = dossier1_oid) 'dossier1_str', (select dossier_oid data.courrier_concerne_dossier courrier_oid = param_oid limit 1,1) 'dossier2_oid', (select concat(a.prefixe_numero, "-", cast(a.numero char), " - ",date_format(a.date_ouverture, '%e/%c/%y'), " - ", b.nom, " - ", a.intitule) data.dossier join data.client b on a.client_oid=b.oid a.oid = dossier2_oid) 'dossier2_str', (select dossier_oid data.courrier_concerne_dossier courrier_oid = param_oid limit 2,1) 'dossier3_oid', (select concat(a.prefixe_numero, "-", cast(a.numero char), " - ",date_format(a.date_ouverture, '%e/%c/%y'), " - ", b.nom, " - ", a.intitule) data.dossier join data.client b on a.client_oid=b.oid a.oid = dossier3_oid) 'dossier3_str',
Comments
Post a Comment