Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / sumit m.

Although the above answer is correct. I am preferring
paranthesis in the answer, something like below:

There are 2 forms of the query for the answer:

SELECT *
FROM (table t1 INNER JOIN table2 t2 ON t1.col = t2.col AND
t2.dept = 'ABC')
LEFT JOIN table t3 ON t1.col = t3.col

OR

SELECT *
FROM (table t1 INNER JOIN (SELECT * FROM table2 WHERE dept
= 'ABC') t2 ON t1.col = t2.col)
LEFT JOIN table t3 ON t1.col = t3.col

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use linked server?

1193


What are the 2 types of classifications of constraints in the sql server?

1124


Explain Capacity planning to create a database? and how to monitor it?

4204


Why olap is used?

974


Can we add an identity column to decimal datatype?

1002


How can i Relate Tables in SSIS

1081


What are the different types of Indexes available in SQL Server?

1008


Explain what you mean by 3 tier architecture.

1077


What is the maximum row of a size?

1018


What is sql injection and why is it a problem? : sql server security

1133


What stored procedure can you use to display the current processes?

893


How do I connect to sql server database?

1015


What number sorts of privileges are accessible in sql?

1037


What is sql server schema compare? How we can compare two database schemas?

1031


How many non clustered indexes there can be on table ?

920