Re: Insert into Tabl
Date: Mon, 27 May 2002 15:38:09 GMT
Message-ID: <3CF252DC.498A8D6D_at_exesolutions.com>
Veit Schopper wrote:
> What about:
> Create or replace view MyView as
> select * from table1 a, table2 b
> where a.col1 = a.col2
>
> and then you can query this with a statemant like this:
>
> select * from MyView where hiredate between '01-jan-2002' and '31-mar-2002';
>
> Regards Veit
>
> CAFM Developer
>
> --
> http://www.kloburgvibes.at
> "lve" <lve3162_at_yahoo.com> schrieb im Newsbeitrag
> news:93096888.0205251736.5ff8126e_at_posting.google.com...
> > I want to create a view like this:
> >
> > Create or replace view MyView
> > (StartDateVARIABLE VARCHAR2,EndDateVARIABLE VARCHAR2)
> > as
> > select a.col1,sum(b.col2)
> > from table1 a,table2 b
> > where a.col1=b.col1 and
> > a.hiredate between
> > StartDateVARIABLE AND EndDateVARIABLE
> > group by a.col1
> >
> > --------------
> > AND THEN I WANT TO DO SOMETHING LIKE THIS:
> > insert into Table3
> > Select * from MyView('01-jan-2002','31-mar-2002')
> >
> > how can I accomplish this
> >
> > Thanks in advance
I hope what you wrote as a typographical error ... because you've got one great Cartesian product.
And SELECT * in any multitable view will give you the joining column information twice.
Daniel Morgan Received on Mon May 27 2002 - 17:38:09 CEST