>>You can run your first select, then select distinct from it. Otherwise you >have to group by People.PeopleID and each field except for ID should be >some aggregative function, like min, but the result may be incorrect in >such case...
>
>The first field in the cursor row (peopleid) is the one I need to be unique, so I added the GROUP By 1 as in the following:
>
> SELECT People.*, Postal.address1, Postal.address2, Postal.city, ;
> Postal.state, Postal.zip, Postal.country ;
> FROM appdata!People ;
> INNER JOIN appdata!Postal ;
> ON People.postalid = Postal.postalid ;
> GROUP BY 1 ;
> INTO TABLE THISFORM.MyTableFolder+'MyTable'
>
>This appears to give me the results I would expect.
>
>You think this is the correct way to get rid of the duplicates in this situation?
>
>Mel Cummings
No, unfortunately it's no longer correct way (or never was correct way). It works in VFP7 and bellow, but would not work in VFP8. It also would not work in SQL Server or Access.
However, I don't see a simple way around the problem except for dividing this into 2 selects - not a good solution or replacing each field with min(field) - not a good solution either...
May be Sergey can post better idea...
Also check recent threads about similar problems started by Michel Fournier...
If it's not broken, fix it until it is.
My Blog