How to work CAML Joins like SQL Joins?

Viewed 11723

I've checked articles on here and Googled till I'm blue in the finger tips. I've read and read and read and just can't seem to wrap my head around CAML Joins in Sharepoint2010.

Question: Can someone please show me a full example of how exactly CAML Join Query compares to SQL Join Query?

*For Example (SQL of Course, just something to work with)*

If I had a Database named "whatever" & it contained two tables.  
We'll name these "tableA" & "tableB", respectively.

Let's say they look like this:

 - tableA - 
ID | Column1 | Column2 | Column3

 - tableB - 
ID | Column4 | Column5 | Column6

SELECT tableA.Column1, tableA.Column2, tableB.Column4 
FROM tableA 
INNER JOIN tableB ON tableA.ID = tableB.ID

Would give me something like:

 - newTable - 
Column1 | Column2 | Column4
 result | result  | result
 result | result  | result
 result | result  | result

So, again, my question is, can I get an exact example of this same operation is inacted upon in Sharepoint 2010 using the CAML Joins Query string?

2 Answers
Related