Click to See Complete Forum and Search --> : how to delete single row from a two have same value


sanjeevpillai
December 20th, 2003, 06:58 AM
sir,
take an example in an table there are 10 rows and 2 rows are identical they contain same values. i want to delete only one row from these two row. it is possible?
if it is possible how can i delete?

buser
December 22nd, 2003, 05:13 AM
it's possible if you've got some unique id in your table
Something like that:
delete from [table]
where [table].id = (select min(id) from [table] t where t.someval = [table].someval)
and t.someval = 'eqval'

buser
December 22nd, 2003, 06:07 AM
MS solution (http://support.microsoft.com/default.aspx?scid=kb;en-us;139444)