Multiple WITH temp tables


I was wondering if it is possible to use multiple WITH temp AS tables within one sql query?
I am trying but get an error saying 'missing SELECT keyword' but the sql inside each WITH temp is ok.

Any help is appreciated or if you can point me towards a good resource on this subject.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Yes, but you only use one WITH clause, but with multiple named statements


temp as select .....
temp2 as select ...
main query

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Guy Hengel [angelIII / a3]Billing EngineerCommented:
a bit more concrete, about the () ...
WITH temp as ( select ..... .... )
   , temp2 as ( select ... ... )
  FROM temp
  JOIN temp2
    ON ...

Open in new window

GerardMcLAuthor Commented:
Thank you for a very fast and very helpful reponse
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.