Contents
You can use SPQuery.Joins: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.joins (office.14).aspx An easy way to getting the Join CAML query syntax is using the Linq to SharePoint to generate the proxy of the required lists.
Do you need a CAML query for spquery?
For SPQuery Class Joins element needs to be specified via SPQuery.Joins Property: Here is the complete CAML query for CSOM API: Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research!
How to create a CAML query in C #?
Working with the CAML query is, for me, not so easy to do on a forum. So what I can suggest to you is to use a tool like that: http://spcamlqueryhelper.codeplex.com/ This will create a perfect CAML query for you, and you will be able to test it and then copy inside your c# or csom code.
Can you use a JOIN statement in SQL?
The Problem is I need to get all the Activities that included the document name on the Document. In SQL I can use Join query to get the additional information from another table. But I have try some Join statement in CAML query and none of them work. Here is the result that I need to get. Could any one please suggest me the query?
Because CAML has the Joins and ProjectedFields elements, the LINQ to SharePoint Provider, which translates LINQ queries into CAML queries, can fully support the LINQ join (Join in Visual Basic) and select (Select in Visual Basic) operators.
How to add a common field in SharePoint?
Open a web part page in SharePoint designer and this linked data view. Now you will see columns from one list added in view. Click on data source details tab and select field in second list. Add them as a joined item. It will open a pop up saying ‘select common field’.
Open a web part page in SharePoint designer and this linked data view. Now you will see columns from one list added in view. Click on data source details tab and select field in second list. Add them as a joined item.
I would like to join 2 lists and display in a single list. Finally, join the above 2 list by the ProductID, and output into following result list:
Can a list be joined to another list?
A list can be joined to itself directly or as a chain of joins. There are requirements to keep in mind when creating list joins. You cannot join just any two lists, regardless of type. And if two lists can be joined, not just any primary and foreign field can be used as the “join on” pair of fields.