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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement

Re: SQL Statement

From: Chrysalis <cellis_at_clubi.ie>
Date: 1998/10/20
Message-ID: <cellis-ya02408000R2010981835150001@news.clubi.ie>#1/1

In article <362cb89c.0_at_news.euroconnect.dk>, "Rajesh M" <raju_m_at_hotmail.com> wrote:

> snip
> I would like to have a single query which returns
> all the OrderNo dated '20-10-98' (i.e., Customer 1000,2000) and OrderNo
> dated before '20-10-98' for customer with OrderDate='20-10-98'.
>
> The expected result for the query is as follows :
> OrderNo OrderDate Customer
> -----------------------------------------------
> 1 20-10-98 1000
> 2 19-10-98 1000
> 3 20-10-98 2000

select ... from tableX X1
where OrderDate <= to_date('20-10-98,'dd-mm-yy') and Customer in
(select Customer from tableX X2
where X2.orderDate = to_date('20-10-98,'dd-mm-yy'));

HTH Chrysalis

-- 
FABRICATE DIEM PVNC
("To Protect and to Serve")
Motto of the Night Watch
Terry Pratchett - "Guards, Guards"
Received on Tue Oct 20 1998 - 00:00:00 CDT

Original text of this message

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