Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group by with Xquery

Status
Not open for further replies.

inarobis

IS-IT--Management
Apr 3, 2006
71
CH
Hello guys,

I have this Xquery statement and I would like to do a group by date but unfortunately doesn't work well

Someone knows it? Any suggestion?


<TEST>
{
for $i in doc("transformXQUERY.xml")//TableID/TableRoom
let $A := $i/A
let $B := $i/B
let $cs-group := //TableID/TableRoom[Date eq $i/Date]
where exists($cs-group)
return

<TEST ID= "{$i/ID}" date="{$i/Date}" A="{sum($A)}" B="{sum($B)}"/>

}
</TEST>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top