Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statement
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