android ContentResolver 多表联合查询

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

            String [] projection= new String[]{
            Phones._ID,

            Phones.TYPE,韩国女装          

Phones.NUMBER,

            "(SELECT NAME FROM PEOPLE AS people WHERE PEOPLE._id =PERSON) AS peopleName",
//            new StringBuilder().append("(SELECT NAME FROM PEOPLE AS people WHERE PEOPLE._id =").append(Phones.PERSON_ID)
//            .append(") AS peopleName").toString(),
            "(SELECT DATA FROM PHOTOS AS PHOTOS WHERE PHOTOS.PERSON =PERSON) AS peopleLogo",
//            new StringBuilder().append("(SELECT DATA FROM PHOTOS AS PHOTOS WHERE PHOTOS.PERSON =").append(Phones.PERSON_ID)
//            .append(") AS peopleLogo").toString()
           
        };     android 软体键盘 实现 -- 断点记录

        String selection = "0==0) GROUP BY (PERSON";
        Cursor cursor = context.getContentResolver().query(Phones.CONTENT_URI, projection, selection, null, null);
        while(cursor.moveToNext()){
            System.out.println(cursor.getString(cursor.getColumnIndex(Phones.NUMBER)));
            System.out.println(cursor.getString(cursor.getColumnIndex("peopleName")));
        }

转载于:https://my.oschina.net/linuxred/blog/32330

你可能感兴趣的:(android ContentResolver 多表联合查询)