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

What is the difference between inner join and equi join?

923


What is the data tier application?

169


What are the main sources of data?

1035


Can you leave a union at any time?

999


What is a matrix in ssrs?

135


Explain what is “asynchronous” communication in sql server service broker?

867


What is the stored procedure?

948


Explain system scalar functions?

951


Define union, union all, minus, intersect?

932


How is sql server used?

906


Where does the copy job runs in the log shipping primary or secondary? : sql server database administration

997


Can you tell me some of the common replication dmv's and their use? : sql server replication

870


How many types of triggers in sql server?

969


Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

912


What is transaction server distributed transaction?

976