Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyway to optimize this
Message
De
20/02/2006 02:17:13
 
 
À
19/02/2006 18:54:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01097411
Message ID:
01097462
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>>two in VFP8
>>
>>SELECT Komintenti.sifra_kom AS sifra, NVL(SUM(Smetki.iznos_sd),0.00) AS iznos;
>>FROM  Komintenti LEFT OUTER JOIN Smetki ON Komintenti.sifra_kom==Smetki.sifra_kom ;
>>GROUP BY sifra INTO CURSOR posmetki
>>
>>SELECT posmetki.sifra
>>  , posmetki.iznos + NVL(SUM(Fakturi.iznos_sd),0.00) AS iznos;
>>FROM posmetki LEFT OUTER JOIN Fakturi ON posmetki.sifra==Fakturi.sifra_kom ;
>>GROUP BY sifra INTO CURSOR final
>>
>>
>>One in VFP9.
>
>Wha will be in VFP9.
>

Nesting of the two select:
SELECT posmetki.sifra
  , posmetki.iznos + NVL(SUM(Fakturi.iznos_sd),0.00) AS iznos;
FROM (SELECT Komintenti.sifra_kom AS sifra, NVL(SUM(Smetki.iznos_sd),0.00) AS iznos;
      FROM  Komintenti LEFT OUTER JOIN Smetki ON Komintenti.sifra_kom==Smetki.sifra_kom ;
      GROUP BY 1) posmetki 
LEFT OUTER JOIN Fakturi ON posmetki.sifra==Fakturi.sifra_kom ;
GROUP BY sifra INTO CURSOR final
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform