Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE SQL, How to use with correlated query.
Message
De
06/05/2005 18:03:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
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 9
Database:
Visual FoxPro
Divers
Thread ID:
01011797
Message ID:
01011833
Vues:
15
Esparta,
Many things are possible with a single query however think of performance too. Check with large tables too.
Cetin

>Thanks Cetin, and yes, it could be better, I was wondering if this is possible with a single query, I'll do the test to see what's the better approach. Thanks again!
>
>
>>Esparta,
>>I think dividing it would be better. Roughly:
>
>Select iAgentId, Month(dDate) As Month, Year(dDate) As Year, Sum(yAmount) As YTot ;
>    FROM cMovs ;
>    GROUP By 1,2,3 ;
>    into Cursor crsSums ;
>    nofilter
>
>Update cAgent ;
>    SET yMonth = t2.YTot ;
>    FROM crsSums t2 ;
>    WHERE t2.iAgentId = cAgent.iid ;
>    AND cAgent.nMonth = 1 And cAgent.nYear=2005 ;
>    And t2.Month = cAgent.nMonth ;
>    AND t2.Year = cAgent.nYear
>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform