lundi 23 février 2015

Ambiguous column name, yet use "." to specify table

When the following query is sent to my database:



SELECT statemachines.statemachinename,
states.statename,
actionhandlers.actionhandler,
actions.value, actions.sourcename
FROM actions, actionhandlers, states, statemachines
INNER JOIN rules ON (actions.rule_id AND rules.rule_id)
INNER JOIN actionhandlers ON (actions.actionhandler AND actionhandlers.actionhandler)
INNER JOIN states ON (states.state_id AND actions.state_id)
INNER JOIN statemachines ON (states.statemachinename AND statemachines.statemachinename)
WHERE (rules.eventname = 'PIR') AND (statemachines.currentstate = states.state_id)


The following error is returned:



android.database.sqlite.SQLiteException: ambiguous column name: statemachines.statemachinename (code 1): , while compiling:


I have no clue what to do, all my other queries work.


Aucun commentaire:

Enregistrer un commentaire