better delete statement to remove duplicate rows from exception table?

2003-12-11 Thread Jacques Kilchoer
In the situation below, is there a better way to write the delete statement that eliminates duplicates? (assuming duplicate rows form at most 5 % of the table rows) Notice that the exceptions table is not analyzed. If I analyze the exceptions table, is there then another better way to write it?

Re: better delete statement to remove duplicate rows from exception

2003-12-11 Thread Dias Costa
Hi, You can do this: delete from orders o1 where rowid(select max(rowid) from orders o2 where o1.order_id = o2.order_id group by order_id having count(order_id) 1);