I think this is what you need:DECLARE @table table ( Product_code varchar(30), TAG int, product_price decimal(18, 2), product_base_price decimal(18, 2) )insert into @tableSELECT 'BCE1119', 1033, 4, 5.75 UNION ALLSELECT 'BCE2040', 1033, 2.01, 22.17 UNION ALLSELECT 'BCD1018', 1538, 11.97, 17.35 UNION ALLSELECT 'BCC1015', 1538, 9.15, 10.09select * from @table--> See which data to delete:select * from @table a inner join @table b on a.TAG = b.TAG where b.product_base_price < a.product_price--> Do the actual delete:delete bfrom @table a inner join @table b on a.TAG = b.TAG where b.product_base_price < a.product_priceselect * from @table
- LumbagoIf the facts don't fit the theory, change the facts. Albert Einstein