查询生成错误

Max*_*nin 0 java android

我正在做请求,它写了一个错误ID - INTEGER PRIMARY KEY帮助

cur = db.query("Sales_region_table t1, region_table t2  join region_table t2 on t1.id_region = t2.id ", null, " id_region = " + id_region + " and id_category = " + id_category + " and id_product = " + id_product + " ", null, null, null, null);
Run Code Online (Sandbox Code Playgroud)

11-01 08:28:10.600:I/Database(1251):sqlite返回:错误代码= 1,msg =不明确的列名:t2.id

Buh*_*ndi 5

问题在于:

region_table t2  join region_table t2
Run Code Online (Sandbox Code Playgroud)

您正在选择region_table t2并加入同一个表(具有相同的别名).

这会导致RDBMS出现歧义.