Re: problem selecting from one table where not in another
Hello, it is exactly as you say players play in teams and teams in leagues.
There is another table for the users teams but in this case it is not used. The table usuarios_jugadores holds all the players that users have, along with the league they play in (found it convinient saving the league id in the players table) and that is why there is no reference to the team id. The marketplace table, mercado_fichajes, holds all players that are for sale and the league id is also saved in this case. So basically the query is supposed to return one player that is not in the usuarios_jugadores or the mercado_fichajes for a specific league.
the variable nivel is just the player level, the higer the number the higher the level of expertise. The query is supposed to fetch a player with the same level.
Thank you