Join 3 tables (table1, table2 & table3) in a single query.

Inner join should be applied for table1 & table 2 and left
outer join for table1 & table3 where table2.dept is ABC

Answer Posted / dhanasekaran

select *
from table1 t1
inner join table2 t2 on t1.key = t2.key
left outer join table3 t3 on t1.key = t3.key
where t2.dept ='ABC'

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference Between ORDER BY Clause and GROUP BY Clause in SQL?

625


Which joins are sql server default?

504


What is merge join?

570


Explain what are sparse columns?

564


How do you manipulate data?

489






What is exporting utility?

538


You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?

1720


Explain the etl (extraction, transformation, and loading)?

556


What is a file group?

613


What is use of attribute hierarchy optimized state? : sql server analysis services, ssas

582


How to stop a loop early with break statements in ms sql server?

565


What is the difference between a primary key and a unique key? Are they the same?

538


Explain forward - only cursors?

513


What is the difference between Stored Procedures and triggers?

570


What are data resources?

502