Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyway to optimize this
Message
From
20/02/2006 02:17:13
 
 
To
19/02/2006 18:54:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01097411
Message ID:
01097462
Views:
19
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
Previous
Reply
Map
View

Click here to load this message in the networking platform