Beginner's SQL: Cross Joins

10515 Users read it.
by Rudy Limeback

A BAZILLION ROWS OF DATA! Has this ever happened to you? You have a working SQL query to retrieve data from a database table. Now you want to add a second table into the query, for related or more detailed data, and all of a sudden you have a bazillion pages of output. You have discovered the dreaded cross join effect. Despair not.

Whenever there are two tables in an SQL query, they will be joined. This means the rows of one table are combined with the rows of the other table. You must always pay attention to how you want them to be joined. With a bazillion rows, maybe you don't want a cross join. Other times, a cross join is exactly what you want. So let's look at this cross join effect more closely.

 

User Rating (16 votes)
For multiple purchases and discounts contact us
$3.39 USD Live Support Support Forum

User Level:Beginner
Product:Dreamweaver MX, UltraDev 4
Server Model:ASP JavaScript, ASP VBScript, ASP.NET C#, ASP.NET VB, ColdFusion (UD4), ColdFusion (DWMX), JSP, PHP ImpAkt 1(UD4), PHP MySQL (DWMX), PHP PHAkt 1 (UD4)
Number Of Pages:13

Rudy Limeback

Rudy LimebackRudy Limeback is an independent consultant with over 20 years of SQL experience using DB2, SQL Server, Access, Oracle, and MySQL. Rudy is also a Web developer, Technical Editor at Digital Web, one of the original evolt.org admins, with his own Web site since 1996. More information at r937.com. Rudy lives in Toronto, Canada, where the weather allows you to play frisbee golf all year long.

See All Postings From Rudy Limeback >>

Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency