XQuery Statement (Group by)*
Houman Khorasani <[email protected]>
| Newsgroups | gmane.comp.web.query-languages |
|---|---|
| Message-ID | <[email protected]> |
*Sorry I forgot first to subscribe to the list. Sorry if you receive my
request a second time.
Hello,
I would like to translate this SQL statement into XQuery.
SELECT
`dat`, AVG(dlay), SUM(dlay)
FROM
`wisc_berkeley`
WHERE dat='20000801000000' AND `tick` < 100000
GROUP by dat;
I tried this in this way, but yet I dont know how to translate the group
by.
for $i in doc('wisc_berkeley.xml')/data/row
where ($i/dat = '20000801000000' and $i/tick < 100000)
return
<ROW>
{ $i/dat }
<sumDelay>{ sum($i/dlay) }</sumDelay>
<avgDelay>{ avg($i/dlay) }</avgDelay>
</ROW>
Any comments please?
Houman