f0fd547b80cbcd0e7d117fbe0f36393db9f47e5b max Fri Mar 2 12:04:38 2012 -0800 sorted t2g results by year now diff --git src/hg/hgc/t2g.c src/hg/hgc/t2g.c index 1e2a6e3..e1670da 100644 --- src/hg/hgc/t2g.c +++ src/hg/hgc/t2g.c @@ -59,31 +59,33 @@ return nameListString; } static struct sqlResult* queryMarkerRows(struct sqlConnection* conn, char* markerTable, char* articleTable, char* item, int itemLimit, char* sectionList) /* query marker rows from mysql, based on http parameters */ { char query[4000]; /* Mysql specific setting to make the group_concat function return longer strings */ sqlUpdate(conn, "SET SESSION group_concat_max_len = 40000"); safef(query, sizeof(query), "SELECT distinct %s.articleId, url, title, authors, citation," "group_concat(snippet, section SEPARATOR ' (...) ') FROM %s " "JOIN %s USING (articleId) " "WHERE markerId='%s' AND section in (%s) " - "GROUP by articleId LIMIT %d;", + "GROUP by articleId " + "ORDER BY year DESC " + "LIMIT %d", markerTable, markerTable, articleTable, item, sectionList, itemLimit); if (t2gDebug) printf("%s", query); struct sqlResult *sr = sqlGetResult(conn, query); return sr; } static void printSectionCheckboxes() /* show a little form with checkboxes where user can select sections they want to show */ { // labels to show to user, have to correspond to t2gSecNames