Hi All,
It can only return 1 item.
How can I get the following result:
guestId Total
1 20000
2 20000
Thanks.
Anderson
What you want to do here is a bit unclear to me, as you are getting the values from the SQL query. The amount that is going into this node has no influence on that.
for SQL it only runs for the first item, that is correct. So what you could do is use the itemlists node to aggregate the guestid’s and then alter the query a bit to take an array and select the guestids that way.
or use split in batches to create a loop (Looping - n8n Documentation)
This will work but for this input would result in a duplicate item for guestid 2
That it would as it is defined twice.
What about using the split in batches (as recommended) then use a code node to merge the execution data?
This should works for me. Thank you.