开发者

android how to do a select and where join statement

开发者 https://www.devze.com 2023-02-12 08:15 出处:网络
SQLiteDatabase db = dbs.getReadableDatabase(); String SQL = \"SELECT * FROM one a \" + 开发者_运维百科\"join two b on a.oneID = b.twoID \" +
    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

精彩评论

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