O'Reilly logo

SQL Fundamentals, Third Edition by John J. Patrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Cross Joins, Self Joins, and CrossTab Queries

This chapter finishes the discussion of techniques used to join two tables. You will not use these techniques very often, but knowing them will add depth to your understanding of all joins. They will also enable you to get results that would be almost impossible to obtain otherwise.

A cross join is used to define an inner join. It is also important in detecting errors in your code. Cross joins of small tables are acceptable and useful at times, but cross joins of large tables should be avoided.

A self join involves joining a table with itself. This is necessary when you need information from several rows of the same table at the same time.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required