DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Joins in Delete statement

  1. #1
    Join Date
    Jan 2001
    Posts
    642
    Hi,
    Can't I use the joins in the delete statement. If possible, could someone give me the syntax for deleting from table a and table b where a.account_num = b.account_num.

    Badrinath

  2. #2
    Join Date
    Jan 2001
    Posts
    2,828
    use the on delete cascade feature of the foreign key so oracle automatically deletes the rows in the child table when rows in the parent table are deleted.else you gotta use database triggers for accomlishing the same

  3. #3
    Join Date
    Feb 2001
    Location
    Kolkata- India
    Posts
    356
    Try the following
    delete from abc where no in (select no from def where no = 1);

    Beware this can be slow on large tables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width