Monday, February 24, 2014

Concept of using a lot of JOIN's in a SQL database query

Usually too much or too little detail. Each JOIN acts like a transition. For example, take a look at the figure and the example below.

SELECT bt.columnA, gt.columnB, bt.columnC FROM black_table
JOIN red_table AS rt ON black_table.columnB=red_table.columnB
JOIN blue_table AS bt ON black_table.columnC=blue_table.columnC
JOIN green_table AS gt ON red_table.columnB=green_table.columnC


I'm quickly writing this out just to share.

No comments: