Last active
June 25, 2017 08:53
-
-
Save MkhytarMkhoian/b22ab64952a2b2844dcdae321f88c401 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static final String CREATE_CATEGORIES_TABLE = "create table " + Category.TABLE + "(" + | |
| COLUMN_ID + " integer primary key autoincrement, " + | |
| Category.COL_NAME + " text, " + | |
| Category.COL_COLOR + " integer, " + | |
| Category.COL_CREATE_BY_USER + " integer DEFAULT 0 " + | |
| ");"; | |
| static String LIST_QUERY(String selection) { | |
| String query = "SELECT *, COUNT(i." + ListItem.COL_STATUS + ") " + List.COL_SIZE | |
| + ", SUM(i." + ListItem.COL_STATUS + ") " + List.COL_BOUGHT_COUNT + | |
| " FROM " + List.TABLE + " s" + | |
| " LEFT OUTER JOIN " + ListItem.TABLE + " i" + | |
| " ON s." + List.COL_ID + " = i." + ListItem.COL_PARENT_LIST_ID; | |
| if (selection == null) { | |
| return query + " GROUP BY s." + List.COL_ID; | |
| } | |
| return query + " WHERE " + selection + | |
| " GROUP BY s." + List.COL_ID; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment