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 the difference between truncate and delete commands?

563


What is a DBMS, query, SQL?

575


What is normalization and denormalization in sql server?

535


What is difference between materialized view and view?

484


How to create a simple stored procedure in ms sql server?

519






What is difference between temp table and cte?

531


What are the steps you will take to improve the performance of a poor performing query?

593


Why truncate is ddl command?

512


How data can be copied from one table to another table?

507


What is query cost in sql server?

549


How to create hyperlink from returned sql query ?

618


How to connect a database with sql express.?

566


Why use update_statistics command in sql server?

549


What are the steps to process a single select statement?

509


What is sql stored procedure?

599