|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Help with Outer JoinI have 2 docs with information that may or may not be related. I need to get every record, but no duplicates (if they're related - they're treated as 1). To illustrate: <doc1> <person> <number>123</number> <fname>Bob</fname> </person> <person> <number>345</number> <fname>Jane</fname> </person> </doc1> <doc2> <surname> <num>234</num> <lname>Smith</lname> </surname> <surname> <num>123</num> <lname>Jones</lname> </surname> </doc2> I need to construct a Join query that will return every <num> - combining any data where <num>'s are the same. Results of the query would be something like: '123', 'Bob', 'Jones' '234', '', 'Smith' '345', 'Jane', '' I know how to get all the first names OR all the last names... don't know how to get both. Thanks> One more thing... not sure if it'll matter - but it would also be helpful if I could Order By <num>. -- View this message in context: http://old.nabble.com/Help-with-Outer-Join-tp26160480p26160480.html Sent from the exist-open mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Exist-open mailing list Exist-open@... https://lists.sourceforge.net/lists/listinfo/exist-open |
|
|
|
|
|
Re: Help with Outer JoinHi,
you could try this query : for $n in distinct-values(//(person|surname)/(number|num)) let $p:= //person[number=$n] let $s:= //surname[num=$n] order by $n return concat("'",$n,"','",$p/fname,"','",$s/lname,"'") --- Bivi
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |