Skip to content

SQL Test Queries GROUP BY

David Lidström edited this page Nov 5, 2017 · 3 revisions

These are the tests and expected results for different GROUP BY queries.

These tests can be found in camlsql.sql_groupby.spec.js.


NOTE Group By is not supported by the SharePoint REST services. When using it with camlsql exec method the grouping will be done within the camlsql library when the data has been retreived.

However, when providing the <GroupBy> element in the CAML XML query the OrderBy option will have no effect. For this reason the GroupBy element will be removed from the XML when you use the camlsql.exec function.


TBD

SQL GROUP BY Test Query #001

  1. "SELECT * FROM List1 GROUP BY Title", `[]
<View>
    <Query>
        <GroupBy>
            <FieldRef Name="Title" />
        </GroupBy>
    </Query>
</View>

SQL GROUP BY Test Query #002

When executing using exec method (pass true to getXml method)

  1. "SELECT * FROM List1 GROUP BY Title"
  • (Empty result)