What is the primary key of the Table PreStage???Try out this query INSERT INTO Stage(Manufacturer,ManfProductCode,ProductName,SupplierID,SupplierProductCode,OurPrice)SELECTb.Manufacturer,a.ManfProductCode,b.ProductName,b.SupplierID,b.SupplierProductCode,a.OurPriceFROM ( Select Min(PK) As PK,Min(OurPrice) OurPrice, ManfProductCode From PreStage Group by ManfProductCode ) As aInner Join PreStage b on b.pk = a.pk Where Not Exists ( Select * From Stage s Where s.ManfProductCode = a.ManfProductCode )Replace PK with the primary key column of the Table PreStage.
Chiraghttp://chirikworld.blogspot.com/