When you stop to think about what the group by clause does, we really shouldn't be able to "leave out" fields in the aggregation. It's a "quirk" of foxpro that I have exploited often when I know what I am losing. But it is dangerous for folks that don't know what might be missing in their result set.
>This should be easy for seasoned c/s pros but I have problem getting around it. In MSSQL, columns that appear in the select list
"must be" used as arguments of an aggregate function in the GROUP BY clause. For example, in VFP you could do this:
>
>SELECT table1.*, table2.field1, table2.field2, table2.field3
> FROM table1 JOIN table2 ON table1.fieldx=table2.fieldx
> GROUP BY table2.field2
>
>But you can't do this with MSSQL. How do I get around this "feature"?
Timothy D. Yeaney
MCSD, Charter Member
President, PAFOX (Potomac Area Fox User Group)
mailto:
tim@eagleeyeinc.com Vice President
Eagle Eye Publishers, Inc
Broaden Your Vision, Sharpen Your Focus