code: public static void removeGroupColumns(List<String> selectColumns, List<String> groups) {		
  		List<String> removedGroups = new ArrayList<String>();	
  		for (String group : groups) {			
  			if (!containsColumnByAlias(selectColumns, group)) {
  				removedGroups.add(group);
  			}
  		}		
  		groups.removeAll(removedGroups);		
  	}
docs: Group by columns must be removed if the columns from select sql are deleted