0
嗨,我是新來的android。我想在sqlite中編寫連接查詢。我的代碼是 -如何在android sqlite中編寫連接查詢?
public Cursor SearchCategory(SQLiteDatabase db){
//return db.query("category_master", null, "status = 'Active'", null, null, null, null);
String Category_Sql = " select category_master.*,count(*) as cnt from product_master " +
" left join category_master on product_master.category_id = category_master.category_id " +
" where category_master.status = 'Active' group by category_master.category_id having cnt > 0 ";
return db.query(Category_Sql);
}
但它會產生錯誤。我錯在哪裏?
發表您的錯誤。 –
你可以參考[這篇文章](http://www.anddev.org/sqlite_join_problem-t877.html)。 – Uttam