SELECT pokemons.name, primary_type, secondary_type types.name, FROM pokemon.pokemons JOIN pokemon.pokemon_trainer JOIN pokemon.types JOIN pokemon.trainers WHERE primary_type; SELECT pokemons.name, prime.name, second.name FROM pokemon.pokemons JOIN pokemon.types prime ON (prime.id = pokemons.primary_type) JOIN pokemon.types second ON (pokemons.secondary_type = second.id) #WHERE primary_type = types.id;