Query configuration problem

I have a problem that I can’t solve:
In the database I have two tables, one to list “travel” and the other to list “tickets”


I have generate a table on a PHP page that through a query lists all the available travel (IDtravel) with all the fields, including a numerical field of the available places


In the Tickets Table (IDticket) there are all data including the number of seats booked (for each travel)

I would like to insert a column in the table with the data of the booked places relating to the IDtravel record, taking from the Tickets table by adding the result (SUM)

I tried to configure various query solutions, but it doesn’t work

I don’t know if I explained enough, but if someone has any ideas, thank you in advance

Anyone know how to do it?
In practice I have reached the point that I have a table on the page that lists (repeat) all the “ID” records
Then I also have a Connect Server connected to another database table, which through a query sums all the numerical values of the places booked, with a GET “ID” parameter
The current result of all places booked gives a correct number, and if I manually enter a value of a “ID” record it effectively filters the total

What I can’t do is being able to add a column in the table (repeat) where to insert the “places booked” data by filtering it with the ID table value

You need to check this:

to see how to filter the second table using a value from the first one. In the second table query builder you can use the aggregate functions to return SUM:

Thanks Teodor
I hope it can solve my problem and I hope above all I don’t make mistakes
I’ll let you know if everything is ok

I will follow the instructions
However, I hope to achieve this result, where the last column reports the sum of a field of a second query, filtered for the value of the first column ID (main query)
Also because that value will then serve to set up some operations with other records of the record line

Schermata 2023-08-15 alle 18.46.51

I followed the instructions, but I probably be wrong because it is as a result of an error

Sorry marzio but that has nothing to do with what i posted above. The tutorial i sent you shows how to nest a query and filter it with the result of another one.
Your screenshots show something totally different. Just follow the tutorial i linked to and adjust it per your requirements for summing the values …

Sorry Teodor I thought the last post was evolution. I restart again

Sorry Teodor
but i got lost
I ran following the tutorial, but when I got to this point I don’t find it. It doesn’t appear to me like in the instructions

well, Marzio you can turn app connect mode off to be able to see the content if no dynamic data is available.

I continued but then I get to repeat2 and it doesn’t let me choose repeat2

I don’t understand what exactly you’re doing from your screenshot.
Just follow the tutorial i sent you, there’s nothing more required and there’s nothing more i can explain you than what’s already explained there…

Okay
Double check, maybe I did something wrong
The tutorial was done with an old version of Wappler and certain procedures have changed
Thank you

Nothing in the process has changed actually.

1 Like

Thanks Teodor
then thanks to your advice I got completely what I needed