Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by error
Message
De
23/06/2003 09:51:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Group by error
Divers
Thread ID:
00802887
Message ID:
00802887
Vues:
42
I need to retrieve the pi_id for the latest expdate by pitype. in vfp 7 I would do:
SET ENGINEBEHAVIOR 70
SELECT ;
	pi_id,;
	pitype_id,;
	MAX(expdate);
	FROM PI ;
	WHERE eqtype_id=2 AND equip_id=2246 ;
	GROUP BY 2;
	INTO CURSOR cc1
in vfp 8 that gives me a group by error
SET ENGINEBEHAVIOR 80
SELECT ;
	pi_id,;
	pitype_id,;
	MAX(expdate);
	FROM PI ;
	WHERE eqtype_id=2 AND equip_id=2246 ;
	GROUP BY 1,2;
	INTO CURSOR cc1
works but gives me all records because pi_id is the unique primary key (which i AM AFTER)


What to do?

Peter
Peter Cortiel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform