数据库结构:
public final class ManufacturersColumns implements MyStyleBaseColumns {
public static final String ALIAS = "alias";
public static final String MANUFACTURER_ID = "manufacturer_id";
public static final String NAME = "name";
public static final String TABLE_NAME = "manufacturers";
public static final String CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + "( "
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ ALIAS + " TEXT, "
+ DATE_DELETED + " DATE, "
+ DATE_CREATED + " DATE, "
+ DATE_MODIFIED + " DATE, "
+ MANUFACTURER_ID + " TEXT, "
+ NAME + " TEXT "
+ ");";}
public final class ManufacturersUserCreatedColumns implements MyStyleBaseColumns {
public static final String MANUFACTURER_ID = "manufacturer_id";
public static final String NAME = "name";
public static final String TABLE_NAME = "manufacturers_user_created";
public static final String CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + "( "
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ MANUFACTURER_ID + " TEXT, "
+ NAME + " TEXT, "
+ DATE_CREATED + " DATE, "
+ DATE_MODIFIED + " DATE, "
+ DATE_DELETED + " DATE, "
+ SYNC_FLAG + " NUMERIC "
+ ");";
}
现在我们使用下面提到的查询来列出名称:
<string name="kGetAllManufacturers"><![CDATA["SELECT _id, manufacturer_id, name, alias, usergen FROM (SELECT _id, manufacturer_id, name, alias, 0 AS usergen FROM manufacturers UNION SELECT _id, manufacturer_id, name, '' AS alias, 1 AS usergen FROM manufacturers_user_created) main ORDER BY lower(name) ASC"]]>
要求是:
需要更改上面经常选择的列表名称的查询。
提前致谢。