Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Collapse JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Expand CreateCreate
     

Cross Join

 
      
Capitals
Country Capital
India New Delhi
USA Washington
France Paris
Continents
Country Continent
India Asia
USA N.America
Italy Europe
---- Produces the Cartesian product of the tables involved in the join.
SELECT Capitals.*, Continents.Continent FROM Capitals CROSS JOIN Continents
Output
Country Capital Continent
India New Delhi Asia
USA Washington Asia
France Paris Asia
India New Delhi N.America
USA Washington N.America
France Paris N.America
India New Delhi Europe
USA Washington Europe
France Paris Europe