Hi guys,
a question about anvil query syntax.
I have a games table with a field players linking to multiple rows of the players table.
Then, given a list of players, I am trying to build a query that returns all the games played only by a sub-set of this list.
So, to give sample data, this is my ‘games’ table:
I am looking for all the games played by only A, B and C players, but not necessarily all 3 of them.
So, the query should return games 1, 2, 4, 7.
I can’t figure out a way to write that in anvil’s query syntax.
Doing that would be perfect.
So, I tried to simplify the query by searching all the games played at least by one of A, B or C, in order to clean the results later.
My attempts led to this kind of code:
games = app_tables.games.search(game_players=q.any_of(players))
where players is the list of players table rows.
But this gives me only game 7 as a result.
Here’s the small test-app clone link to see tables and code.
https://anvil.works/build#clone:VLCFMV3HSEQLG44J=TNLZDEK5GKDBAMIXHCS63T2C
Any help is appreciated.
Thanks and BR