Snip...
>What value should SQL Server return for
city? Within this table there will probably be more than one city for each state. VFP picks a value. I don't know of there's any reasoning to the value that's chosen nor would I want to rely on it. SQL Server (and the ANSI standard I believe) take the easy approach and just don't allow it.
>
>BTW, this query should return all the info that you thought the above query would (I hope, it's completely off the cuff <s>)
>
>
SELECT city, state, population
>FROM countrydata
>WHERE population = (
> SELECT MAX(population)
> FROM countrydata cd
> WHERE state = countrydata.state)
I would have to agree, VFP should do the same thing.
As for your correlated sub query, what is the "cd" in the from clause for, or is it one of those off the cuff things :) I will have to play around with sub queries, they could be pretty potent.
Thanks
Jon
Non-MVP Non-MCP Non-MCSE
Visual FoxPro, What else is there?