Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL DELETE Question
Hi,
Yes, you can.
delete from tablename
where (col1, col1, col3) in (select colx, coly, colz
from another_table where......);
regards,
Michael Ringbo, dde a/s
k_chui_at_my-dejanews.com wrote:
> I'm doing joins and adding WHERE clauses to my DELETE statement (example
> below)
>
> DELETE from TABLENAME
> WHERE OPERATOR_ID =
> (SELECT A.OPERATOR_ID
> from TABLENAME A, TABLENAME B,
> WHERE........)
> AND DEPT_ID =
> (SELECT A.DEPT_ID
> from TABLENAME A, TABLENAME B,
> WHERE........)
> AND....
>
> Right now I'm writing a subquery for each field, but I want to minimize the
> amount of typing and cut/paste for the DELETE because it might run 2+ pages.
> I need to know if I can do something similar to an INSERT-type statement
> below, but with the DELETE command instead:
>
> INSERT into TABLENAME
> (FieldA,
> FieldB,
> FieldC)
> SELECT
> Field A,
> FieldB,
> FieldC
> FROM......
>
> Thanks.
> KC
> kchui_at_smtpgw.arms.ohio-state.edu
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
--
to reply, remove the "-nospam" from the address
Received on Fri Jun 12 1998 - 03:24:11 CDT
![]() |
![]() |