Solved

In what scenario should I using cross outer join?

Posted on 2014-01-23
2
936 Views
Last Modified: 2014-01-24
When can I user cross outer join in SQL Server?
0
Comment
Question by:RajG1978
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Assisted Solution

by:Koen Van Wielink
Koen Van Wielink earned 250 total points
ID: 39805571
A cross join produces the cartesian product of the tables you combine (all rows from table 1 x all rows from table 2). One application I can think of is if you're trying to analyze certain scenarios, and you need to have a list of all possible combinations that make up a scenario.
For example, say that you have a list of motherboard parts in 1 table, and a list of CPU parts in another table, and you want to generate a list of all the possible combinations of motherboards and CPU's (e.g. for a price list) you can use a cross join on both tables to do this.
If you use a cross join but put a link between the 2 tables in the WHERE clause it will behave like a normal inner join.
More info here:
http://technet.microsoft.com/en-us/library/ms190690(v=sql.105).aspx
0
 
LVL 13

Accepted Solution

by:
magarity earned 250 total points
ID: 39805573
When you have a requirement that needs that functionality; not sure how anyone here could answer that for you. Typically for a matrix of every combination: suppose you want a matrix of every color for every dress for every size:
select color, size, dress from color_table, size_table, dress_table
0

Featured Post

ClickHouse in a General Analytical Workload

We have mentioned ClickHouse in some recent posts, where it showed excellent results.

In this article on Experts Exchange, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question