sql - How to delete rows using CTE and INNER JOIN? -


how can delete data table using cte , inner join? valid syntax, should work:

with my_cte ( select distinct var1, var2 table_a ) delete   table_b b inner join my_cte    on var1 = b.datecol , var2 = b.mycol; 

in oracle neither cte nor inner join valid delete command. same applies insert , update commands.

generally best alternative use delete ... ... in:

delete table_b (datecol,  mycol) in (   select distinct var1, var2 table_a) 

you can delete results of subquery. covered (though lightly) in docs.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -