Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Androidで次のクエリがあります
query = "SELECT docid as _id," + KEY_ID + "," + KEY_NAME + "," + " from " + filter + " where " + KEY_SEARCH + " MATCH '" + txt + "';";
フィルターに応じてテーブルから選択します
私がやりたいのは、1 つのクエリで 2 つのテーブルから選択するためのフィルター「all」を用意することです
どうすればできますか?ありがとう
簡単な方法:
String sql = "SELECT ColumnName, ColumnAge FROM table1 SomeColumn= " + SomeValue + " UNION SELECT ColumnName, ColumnAge FROM table2 SomeColumn = " + SomeValue; Cursor c = db.rawQuery(sql, null);