Wednesday, February 15, 2006 8:48 PM
SELECT tblWatchInstance.RepairNumber, tblWatches.Serial_Number, tblWatches.OwnerFName,
tblWatches.OwnerLName, tblWatchColors.Description, tblRepairCodes.Name,
tblWatchTypes.Description FROM tblWatchInstance INNER JOIN tblWatches ON
tblWatchInstance.Watch_Key = tblWatches.WATCH_KEY INNER JOIN tblWatchColors ON
tblWatches.COLOR_KEY = tblWatchColors.COLOR_KEY INNER JOIN tblWatchBrands ON
tblWatches.BRAND_KEY = tblWatchBrands.BRAND_KEY INNER JOIN tblWatchTypes ON
tblWatches.WATCHTYPE_KEY = tblWatchTypes.WatchType_KEY CROSS JOIN tblWatchStyleDial
CROSS JOIN tblRepairCodes WHERE tblWatchInstance.WorkStatusID <= '10'", myConnection)
Nothing is wrong with the statemennt but it seems that, it returns to many results that i do not need I only want to retreive the rows that has an owner name asscoicated with it....any help
Wednesday, February 15, 2006 8:54 PMModeratorHard to help you without any DDL. But what you are producing is called a carthesian product. Why are you cross-joining the tables to your query ?
HTH, jens Suessmeyer.
Wednesday, February 15, 2006 9:40 PMOk what is a DDL, and it seems the Query analyzer cross joined the tables for me in the Diagram pane, because i have to tables that are not related...also what is a carthesian product??? Sorry more question than answers but my user name should explain it all....THANKS!
Wednesday, February 15, 2006 10:04 PMModerator
first of all, welcome to SQL Server :-) Now to your questions:
DDL -- http://www.aspfaq.com/5006
"Query analyzer cross joined the tables" That wasn´t query analyzer, I guess that was the graphical designer of the enterprise manager.
carthesian product -- http://en.wikipedia.org/wiki/Cartesian_Product
HTH, Jens Suessmeyer.