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...

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

Answer Posted / b.kumar

--MS SQL SERVER

WE CAN DISPLAY RECORDS BY USING 9 JOINS

SELECT TBL1.COLUMN1,TBL2.COLUMN2,---------,TBL10.COLUMN10

FROM TBL1 INNER JOIN TBL2 ON TBL1.ID=TBL2.ID
INNER JOIN TBL3 ON TBL1.ID=TBL3.ID
----
----
----
INNER JOIN TBL10 ON TBL1.ID=TBL10.ID
----------------------------------------
--WE CAN ALSO DISPLAY THE RECORDS WITH OUT USE JOINS

SELECT TBL1.COLUMN1,TBL2.COLUMN2,---------,TBL10.COLUMN10
FROM TBL1,TBLE2,--------,TBL10
WHERE TBL1.ID=TBL2.ID OR TBL1.ID=TBL3.ID OR
----
----
----
TBL1.ID=TBL10.ID
--WE MUST USE WHERE CLAUSE OTHER WISE WE GET Cartesian product.

--------------------------------------------------

WE CAN'T JOIN DIFFERENT TABLES OF COLUMNS BY USING UNION

BECAUSE UNION COMBINES THE TWO OR MORE RESULT SETS
(IT MEANS ROWS)

DIFFERENCE BETWEEN JOIN & UNION

-- JOIN COMBINES TWO OR MORE THE COLUMNS
-- UNION COMBINES TWO OR MORE ROWS

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

1207


Can you always create a cache of a report?

172


How to name query output columns in ms sql server?

958


Are resultset updatable?

945


Differentiate between SQL and ORACLE joins and write their syntax.

1027


When does a workload on SQL Azure get throttled?

131


What is sqlservr.exe - process - sql server (sqlex?press)?

1101


Define left outer join in sql server joins?

954


Which tcl commands are available on the sql server?

1074


Why people hate cursor?

1138


What is the security principal at the database level that represents your session?

929


How exceptions can be handled in sql server programming?

1007


What are the benefits of filtered indexes?

1032


What do you mean by tablesample?

1070


What stored by the model? : sql server database administration

946