Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One SQL, two SQLs, three SQLs, four...
Message
From
21/01/2003 17:04:13
 
 
To
21/01/2003 16:57:51
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00744004
Message ID:
00744016
Views:
9
>Hi All
>
>I can easily do this in VFP
>
>
SELECT <pkfield>,max(field2) as maxfield from <table1> group by <pkfield> into cursor <cursor1>
>
>and then...
>
>
SELECT <field1> from <table1> where <pkfield> in (select <pkfield> from <cursor1>) into cursor <cursor2>
>
>Question is, how can I do this with SQL Server? I'm assuming I won't be able to create a stored procedure on the client's database.
>
>Thanks in advance!

>
SELECT <field1> from <table1> where <pkfield> in (select <pkfield> from (SELECT <pkfield>,max(field2) as maxfield from <table1> group by <pkfield>))
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform