Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select field based on max(other field) ?
Message
From
22/04/2005 10:39:09
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01006645
Message ID:
01007465
Views:
13
>
>SELECT Child.date, Child.Amount, Child.OtherField,;
>       Parent.Name, Parent.Address,Child.ParentId;
>FROM mydbc.Child AChild;
>LEFT JOIN mydbc.Parent ON AChild.ParentId = Parent.Parentid ;
>WHERE Child.date IN (SELECT MAX(Child.date) FROM Child BChild WHERE BChild.ParentId == AChild.ParentId));
>GROUP BY AChild.ParentId
>
>(not tested)

Four stars if I could give them, thank you Borislav. This is the second time that reusing a tale with another alias has solved my problem, going to have to try and remember and reuse that trick.
Previous
Reply
Map
View

Click here to load this message in the networking platform