for $anun in input()/anuncio
let $key := $anun/DGMkey
where count(for $b in input()/anuncio where $b/DGMkey = $key return $anun/DGMkey)>1
return
{ $key , count(for $b in input()/anuncio where $b/DGMkey = $key return $anun/DGMkey)}
consulta mismo DGMkey
Etiquetas:
xquery
consulta ordenar
for $q in input() /anuncio
where $q/ordenBoletin
orderby xs:int($q/ordenBoletin)
return <anuncio>{$q/codigo, $q/ordenBoletin}</anuncio>
Etiquetas:
xquery
consulta mismo codigo y versión
-- query mismo codigo y version:
for $a in input()/anuncio
let $y := $a/codigo
where $a/DGMversionData/DGMversNumber = 99 and
count(for $b in input()/anuncio where $b/codigo = $y and $b/DGMversionData/DGMversNumber=99 return $a/codigo)>1
return
{ $y , count(for $b in input()/anuncio where $b/codigo = $y and $b/DGMversionData/DGMversNumber=99 return $a/codigo), $a/estado}
Etiquetas:
xquery
borrar
----- borro todo el documento
update for $a in input() /entidad[DGMkey="00000"]
do(delete root($a))
----- borro todo el documento
update for $a in input()./DGMnoxml/test.txt
do(delete root($a))
----- borro solo el nombreCampo dentro de un documento con condiciones
update delete input()/anuncio/nombreCampo[//estado="test"]
----- borro solo el nombreCampo dentro de un documento con condiciones
update for $a in input()/boletin
where $a/DGMkey="1560"
do(delete $a/nombreCampo)
Etiquetas:
xquery