Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by error
Message
From
23/06/2003 09:51:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Group by error
Miscellaneous
Thread ID:
00802887
Message ID:
00802887
Views:
39
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
Next
Reply
Map
View

Click here to load this message in the networking platform