On Fri, Nov 27, 2020 at 04:38:42AM +0100, Giuseppe G. A. Celano
scripsit:
> What I was looking for is a “quick way” to get a comparison such that
> an item (when it is repeated more than once) is returned only as many
> times as it appears in both sequences.
I don't know if it's quick, and I don't
Hi Martin,
What I was looking for is a “quick way” to get a comparison such that an item
(when it is repeated more than once) is returned only as many times as it
appears in both sequences. For example, in
for $a in (1,2,3,5,3,3)
where $a = (1,3,2,3, 2)
group by $k := $a
return
{$a}
you get
Am 26.11.2020 um 07:14 schrieb Martin Honnen:
My bad, use
group by $k := $a return {$a}
To describe it clearer, the whole FLOWR should be
for $a in (1,2,3,5)
where $a = (1,3,2,3)
group by $k := $a
return
{$a}
Hello Giuseppe,
Would this do what you want:
let $reference := (1,3,2,3)
for $a in (1,2,3,5,3) where $a = $reference return{$a}
Depending on how your $reference looks like, e.g. if it has many
duplicates, you can compact it by doing let $reference := distinct-
values((1,3,2,3))either way th
Unfortunately this does not work because, if the second sequence has only one 3
(and the first has two 3), I will still get two 3, while I should get only one.
>
> Or more FLOWR like
> for $a in (1,2,3,5,3)
> where $a . = (1,3,2)
> group by $o := $a
> return
> {$a}
> On 25. Nov 2020,
Am 25.11.2020 um 08:39 schrieb Martin Honnen:
Am 25.11.2020 um 06:37 schrieb Giuseppe G. A. Celano:
I have to compare two sequences and find common items, irrespective of
their positions:
for $a in (1,2,3,5,3)
for $u in (1,3,2,3)
where $a = $u
group by $o := $a
return
{$a}
This returns
1
2
Am 25.11.2020 um 06:37 schrieb Giuseppe G. A. Celano:
I have to compare two sequences and find common items, irrespective of
their positions:
for $a in (1,2,3,5,3)
for $u in (1,3,2,3)
where $a = $u
group by $o := $a
return
{$a}
This returns
1
2
3 3 3 3
I would like 3 to be repeated only twi
Hi,
I have to compare two sequences and find common items, irrespective of their
positions:
for $a in (1,2,3,5,3)
for $u in (1,3,2,3)
where $a = $u
group by $o := $a
return
{$a}
This returns
1
2
3 3 3 3
I would like 3 to be repeated only twice (i.e., each item in the first sequence
should
8 matches
Mail list logo