Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL Statement
Message
From
01/05/2002 19:23:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Help with SQL Statement
Miscellaneous
Thread ID:
00651662
Message ID:
00651662
Views:
53
Hi,

Table A is parent-> child with table B
A has PKey and MyName fields
Table B has a PKey, FKey (to A) and MyDate fields

in VFP I can do
select A.pkey, B.Pkey, max(MyDate) from a join b on b.fkey = a.pkey group by a.pkey
and get the record in B with the latest date.

in SQL Server, however, I must group on both A.PKey, and B.Pkey - so question - how can I get from SQL Server a result set like
A.Pkey  B.Pkey
where the second field is the key of the record related to A with the latest date?

TIA,
Ken B. Matson
GCom2 Solutions
Next
Reply
Map
View

Click here to load this message in the networking platform