I have to display ten columns values from diffrent ten
tables.
how many joins are require?

Answer Posted / praveen mehta

There are 2 possible answers
1. No joins required

Ex:
SELECT Col1 As Col from Tab1
Union
SELECT Col2 As Col from Tab2
Union
SELECT Col1 As Col from Tab3
...

2. 9 Joins Required
Ex:
SELECT
t1.Col1,
t2.Col2,
....
FROM Tab1 t1
inner join Tab2 t2 on t1.Col1=t2.Col2
inner join Tab3 t3 on t1.Col1=t3.Col2
....

Is This Answer Correct ?    44 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql server locking?

702


What is user-defined function?

726


How does stuff differ from the replace function?

738


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

794


What are the system database in sql server 2008?

731






What are points to remember while using the fillfactor argument?

714


How to fetch the next row from a cursor with a "fetch" statement?

790


List layers of abstraction microsoft architectured to provide relational db through cloud platform ?

175


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

751


What is store procedure? How do they work? When do you use?

692


What are the different types of data sources in ssrs?

165


Explain how you can configure a running aggregate in SSRS?

131


What is the stuff and how does it differ from the replace function?

732


What is function of master database?

108


What is SQL Azure?

101