Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Need help with a query

Re: Need help with a query

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1998/03/24
Message-ID: <6f7tee$496$3@news01.btx.dtag.de>#1/1

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.de
Received on Tue Mar 24 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US