I'm new here and I'm having a really bad error while trainning querys in SQLite:
I got this tables:
players(id, player_name)
player_killers(kill_id, player_id)
environment_killers(kill_id, name)
player_deaths(kill_id, player_id, date)
When a player dies it register at player_deaths the player_id (Foreign key from players) and if it's a player that killed this player, it will register also at player_killers, with the kill_id as foreign. If the death was caused by a monster, it will register in environment_killers with kill_id as foreign. There's no way to die both by player and environment, so the UNION of player_killers and environment_killers makes the table of player_deaths.
The problem is that player_killers holds the player_id (a integer) and environment_killers holds the name of the mob that killed the player. I wanna do a deathlist in game, where I can manipulate a query to return me the date (in player_death) the name of the killer (union of environment_killers with the join of players and player_killers [by the player_id])
I already did this same exercise in postGreSQL and it returned the value I wanted, my problem,I think, is translating the query between the languages.
SELECT *
FROM (SELECT kill_id, name
FROM players INNER JOIN player_killers
ON player_id = id
UNION
SELECT *
FROM environment_killers) AS all_kills INNER JOIN player_deaths
ON player_deaths.kill_id = all_kills.kill_id
the subquery used in the FROM worked perfectly: it returns the following table
http://ift.tt/1CBgoO0 which holds the kill_id (foreign from player_deaths) and the name of the creature who killed the player. But when I run the full query I got this error:
Error while executing query: Multiple cores in extractColumnMapFromSelect!
I think the problem is in this line FROM environment_killers) AS all_kills INNER JOIN player_deaths
Thank you for having the pacience to read all this, hope someone can explain me what I did wrong, maybe was the way that I renamed the UNION but I did some research and found nothing about it. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire