开发者

android how to do a select and where join statement

    SQLiteDatabase db = dbs.getReadableDatabase();
       String SQL = "SELECT * FROM one a " +
      开发者_运维百科          "join two b on a.oneID = b.twoID " +
                "where a.oneId = '"+Id+"' And where " +
                "b.column2 = 'Inc'"; 
        Cursor cursor2 = db.rawQuery(SQL, null); 
        startManagingCursor(cursor2);

How do i make this statement work?


"SELECT * FROM one a " +
    "join two b on a.oneID = b.twoID " +
    "where a.oneId = '"+Id+"' And " +
    "b.column2 = 'Inc'";

Only once you need to use "where"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜