jeudi 30 juillet 2015

Limit the results of a query

i have this SQL code which obtains information about SharePoint sites, it returns every subsite and sites inside those i need to fix this query in a way that only returns the first subsite and not the rest for example, here i need only the info from EURACI and ignore the rest of the sites under that subsite

for example, here i need only the info from EURACI and ignore the rest of the sites under that subsite

SELECT A.fullurl, A.title, D.[tp_Login], D.[tp_Title], D.[tp_Email] FROM webs A
INNER JOIN [GroupMembership] B ON B.[SiteID] = A.[SiteId]
INNER JOIN [Groups] C ON C.[ID] = B.[GroupID]
INNER JOIN [USERINFO] D ON D.[tp_ID] = B.[MemberID]
WHERE C.[Title] LIKE '%Owners%' and D.Tp_IsActive = '1'
GROUP BY A.fullurl, A.title, D.[tp_Login], D.[tp_Title], D.[tp_Email]
ORDER BY fullurl

any ideas on how can i achive this?

Aucun commentaire:

Enregistrer un commentaire