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: Minus in View?

Re: Minus in View?

From: Andreas Mosmann <keineemails_at_gmx.de>
Date: Thu, 29 Sep 2005 07:04:14 +0200
Message-ID: <1127970254.83@user.newsoffice.de>


xiaoluma_at_gmail.com schrieb am 28.09.2005 in <1127943133.340309.182260_at_o13g2000cwo.googlegroups.com>:

> Hey, there,
> I was trying to create a view to get the new customer# fro year 2005
> using the following code:
> CREATE OR REPLACE VIEW NewCustomers
> AS
> SELECT Customer# FROM tblOrderFact
> WHERE TransDate BETWEEN '20050101' AND '20051231'
> MINUS
> SELECT Customer# FROM tblOrderFact
> WHERE TransDate < '20050101'

Did I miss anything? In that special case, why don't you use only CREATE OR REPLACE VIEW NewCustomers
AS
SELECT Customer# FROM tblOrderFact
WHERE TransDate BETWEEN '20050101' AND '20051231' should have the same result, isn't it?

> The error message told me that MINUS was not allowed in updateble
> views. Can anyone give me suggestions?
I used MINUS in views w/o errors. I do not know for example:

create view XYZ as
SELECT E.cid, e.ctimestamp FROM tberrorlog E WHERE e.ctimestamp BETWEEN To_date('08/01/2005') AND To_date('09-30-2005')
MINUS
SELECT E.cid, e.ctimestamp FROM tberrorlog E WHERE e.ctimestamp < To_date('08-01-2005')

> Thanks.
> Xiaolu

hth
Andreas

-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Thu Sep 29 2005 - 00:04:14 CDT

Original text of this message

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