cursor.execute( "SELECT * FROM `xplt_cases` LEFT JOIN `dgn_cases` ON dgn_cases.rid = xplt_cases.rid WHERE `status`=%(checker)s", { 'checker': status })
I'm new to MySQL and I'm trying to join two tables together to get results, but I get an error message: The column status
in the where clause is ambiguous.
"status" is my function parameter.
Hmm, it looks like both of your tables have a
status
column. Try prefixing it with the table name (alias):Error
Column 'status' in where clause is ambiguous
means that the 2 tables you joined in the query have a column namedstatus
, which is WhyMysql
tells you thatcolumn status is ambiguous
You can solve this problem by indicating which
status
column in the table to use in the query. Example;or