**Edit: Edited post based on user comment**
Assuming you're using SharePoint 2013, you can use REST api to achieve this.
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
function getDataWithCaml(siteurl,listName, caml) {
var endpoint = siteurl+"/_api/web/lists/GetByTitle('"+listName+"')/GetItems";
var requestData = { "query" :
{"__metadata":
{"type": "SP.CamlQuery" }
, "ViewXml": caml
}
};
return $.ajax({
url: endpoint,
method: "POST",
data: JSON.stringify(requestData),
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
}
});}
</script>
Usage:
$(document).ready(function(){
var caml = "<View><Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy></Query></View>";
getDataWithCaml("http://siteUrl","ListUrl", caml).done(function(data)
{
var data= data.d.results;
var result = [];
var lookup = {};
for (var item, i = 0; item = data[i++];) {
var team= item.team; //the team column value
if (!(team in lookup)) {
lookup[team] = team;
result.push(item);
}}
var len = result.length;
console.log(len);
for (i=0; i<len; ++i) {
console.log(result[i].team + ";" + result[i].created + ";" + result[i].score);
}
})
.fail(
function(error){
console.log(JSON.stringify(error));
});
});