I've got a very large table (a billion rows or so), where I need to delete some of them (about 90 million). Unfortunately, there is no index matching the criteria for the deletion, and I can't create one.What I have done is created a second table with the rows that need to be deleted... but now I'm stumped on how to use that. There is no surrogate key on the large table, or this would be easy (I also can't add a surrogate key to the big table).Here's the rough idea:create table verybig(a int,b int,c smallint)create table deleterows(a int,b int)insert into verybig(a,b,c)select 1,2,500union allselect 1,3,1500union allselect 2,3,500union allselect 2,4,1500insert into deleterows(a,b)select a,bfrom verybigwhere c>1000
That should put the pairs (1,3) and (2,4) into the deleterows table. Now, how in the world do I delete from "verybig" only those rows where both a and b match a row from "deleterows"?I'm sure this is conceptually easy and I'll smack myself when someone posts the obvious, but at this point the only approach I can see is a cursor... and 90 million individual deletes sounds painful.Ideas?-b