Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get all records except the latest
Message
 
 
À
30/10/2008 10:25:33
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 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01356683
Message ID:
01358370
Vues:
26
>I cannot get it into one sql statement but here is a foxpro solution for the Date1 case:
>
>set enginebehavior 70
>
>select pk, max(Date1) from mytable where Flag=1 group by fk into cursor ctemp
>
>update mytable set Flag=0 where NOT pk in (select pk from ctemp)

I was thinking along these lines before, but may be because I was thinking too much or something I thought I can not do this this way. So I just went with SCAN/ENDSCAN solution.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform