Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with a query
On Mon, 23 Mar 1998 16:19:09 -0600, dwarakv_at_hotmail.com wrote: Hi,
supposing l_id is a unique key and e_id is a kind of foreign key:
Delete from table_a
where l_id in (Select e_id from table_b )
>Hi,
> I have two tables A and B. I need to delete those records from table A
>which match records in Table B. The description of the two tables are
>
> Table A Table B
>I_id Number E_id Number
>I_date Date E_date Date
>I_code Varchar2(20) E_code Varchar2(20)
>I_start_time Date E_start_time Date
>I_stop_time Date E_stop_time Date
>I_time Number
>I_a_flag Varchar2(1)
>I_p_flag Char(1)
>
>e.g.,
>Table A contains
>
> 8741 22-MAR-98 Open 22-MAR-98 22-MAR-98 .98333333 N Y
> 8741 22-MAR-98 Lunch 22-MAR-98 22-MAR-98 .98333333 N Y
> 7864 21-MAR-98 Open 21-MAR-98 21-MAR-98 .98333333 N Y
> 7864 21-MAR-98 Lunch 21-MAR-98 21-MAR-98 .98333333 N Y
>
>
> and table B contains
>
> 8741 22-MAR-98 Open 22-MAR-98 22-MAR-98
> 7864 21-MAR-98 Lunch 21-MAR-98 21-MAR-98
>
>In this e.g., I would like to delete the first and the last record in table
>A. The start_time and the stop_time hold the time along with the dates.Can
>someone help me with a query for this.
>
>Thanks,
>Dwarak
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Tue Mar 24 1998 - 00:00:00 CST
![]() |
![]() |