Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code this in one select
Message
 
 
À
19/06/2006 19:41:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01130101
Message ID:
01130117
Vues:
16
There's a typo in the query.
   AND mm.state = mm.state 
* should be
   AND xx.state = mm.state 
* or
  AND xx.state = tcState ;
* The following query works in VFP8. I don't have VFP6 to test
SELECT * FROM myTable mm ;
	WHERE mm.ctrl = tnCtrl ;
		AND mm.state = tcState ;
		AND NOT mm.deleted ;
   		AND mm.version = ( ;
 			SELECT MAX(version)  ;
			  FROM myTable xx ;
			  WHERE xx.ctrl = mm.ctrl ;
				AND xx.state = mm.state ;
				AND xx.version <= tnVersion )
* or
...
			  WHERE xx.ctrl = tnCtrl ;
				AND xx.state = tcState ;
				AND xx.version <= tnVersion )
>Thanks for trying but this needs to run in VFP 6. I get "Error correlating fields" (I get the same error in VFP 8.) I also modified it to meet the requirement that it check only records at or below the specified version.
>
>SELECT * FROM myTable mm ;
>   WHERE mm.ctrl = tnCtrl ;
>     AND mm.state = tcState ;
>     AND NOT mm.deleted ;
>     AND mm.version = ( ;
>                       SELECT MAX(version) ;
>                         FROM myTable xx ;
>                        WHERE xx.ctrl = mm.ctrl ;
>                          AND xx.version <= tnVersion
>                          AND mm.state = mm.state )
>
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform