My temp table is something like thisTblA----Rowid Name CustomerName Address1 Address2 Address3 Address4 City PostalCode Country1 Karunakaran ABC 123 Street1 Null Null Bangalore 560001 India2 Karunakaran ABC 123 Street1 Null Null Bangalore 560002 India3 Arun ABC 456 Street2 Null Null Chennai 630001 India
I want to extract the records from this temptable TblA and import it to a different table Tblb, Which has similar columns like TblA and some additional columns. I need to remove the duplicate contact name entries. For E.G. - RowId 1 & 2 are same contact with different addresses, These addresses can either be problem due to Typo or some other issues. So, I'm not really bothered about the address. But I want a query which can fetch the distinct contact name for the customer for that location (based on country) and the address columns for the first record of that contact. TblB----Rowid Name CustomerName Address1 Address2 Address3 Address4 City PostalCode Country1 Karunakaran ABC 123 Street1 Null Null Bangalore 560001 India2 Arun ABC 456 Street2 Null Null Chennai 630001 India
I can use a distinct select query to get the Name for the responding customername, but how do I fetch the addresses for that name/customername pair?. I'll also be running this against a table with 1M records.Karunakaran