Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

WITH clause in insert statement?

RemcoGorisAug 14 2008 — edited Aug 14 2008

Hi,

Can I use a WITH clause in my insert select. Something like this:

with q as
   (
      select a
           , b
        from tabc
   )
insert into tab( volume_x, volume_y )
select sum( s.volume_x ), sum( s.volume_y )
  from ( 
         select q.a  volume_x 
              , 0    volume_y
           from q
          where t.b = 'x'
         union all
         select 0
              , sum( q.a )
           from q
          where t.b = 'y' ) s

??

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2008
Added on Aug 14 2008
2 comments
75,981 views