Click here to Skip to main content
12,357,105 members (77,137 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

5.7K views
2 bookmarked
Posted

UNION ALL between Two CTEs

, 31 Aug 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
The same thing can be done with even less SQL.WITH CTE AS( SELECT * from TableA UNION ALL Select * from TableB)select * from CTE
The same thing can be done with even less SQL.

WITH CTE AS
( 
  SELECT * from TableA
  UNION ALL
  Select * from TableB
)
select * from CTE

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Erik Thompson
Web Developer
United States United States
Erik lives in Redmond, Washington. He works as a Senior Software Engineer specializing in C++, COM, ATL and the middle-tier and now .NET. When he isn't coding for work, he can be found trying to extend Internet Explorer with yet another Desk band or simplifying his development process with ATL Object Wizards.

He spends his free time snowboarding, mountain biking, and online gaming.

You may also be interested in...

Comments and Discussions

 
GeneralI know that it can be done that way. but intention of my tri... Pin
Hiren Solanki31-Aug-10 20:23
memberHiren Solanki31-Aug-10 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 31 Aug 2010
Article Copyright 2010 by Erik Thompson
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid