troubleshooting Question

SQL query

Avatar of sqldba2013
sqldba2013 asked on
Microsoft SQL ServerMicrosoft SQL Server 2008SQL
7 Comments2 Solutions590 ViewsLast Modified:

I am fetching data from three different tables and column names are different in all three tables and there is no relationship between these three tables.

Select a1,a2,a3 from temp1
Select b1,b2,b3,b4,b5 from temp2
Select c1,c2 from temp3

At the end of query I have to display all three tables results in single output using sql query.
For ex:
a1	a2	a3	b1	b2	b3	b4	b5	c1	c2

Please advise how to achieve above requirement using sql query.

Thanks in advance.
Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros