Subject:problem with xquery Author:lafosse alexandre Date:07 Dec 2004 04:44 AM
Hi,
I have a mistake with xquery. I have executed this query
with stylus studio. In result, I should have like result, for
each users the number of bids whereas i have only two users.
Do you know what is the mistake?
*********************************************************
<result>
{
for $uid in (doc("bids.xml")//userid),
$u in doc("users.xml")//user_tuple[userid = $uid]
let $b := doc("bids.xml")//bid_tuple[userid = $uid]
order by $u/userid
return
<bidder>
{ $u/userid }
{ $u/name }
<bidcount>{ count($b) }</bidcount>
<avgbid>{ avg($b/bid) }</avgbid>
</bidder>
}
*************************************************************
with this xml documents :
Subject:problem with xquery Author:(Deleted User) Date:07 Dec 2004 05:49 AM
Hi Alexandre,
check your bids.xml file; it looks like the official bids.xml from the
use cases, but, starting from the third "bid_tuple", it uses a capital "o"
instead of a zero in the user id.