sqlparser/select.cpp
// GROUP BY clause in SELECT statement
GROUP BY clause in SELECT statement
GROUP BY clause in SELECT statement
bool SqlParser::ParseSelectGroupBy()
{
	Token *group = GetNextWordToken("GROUP", L"GROUP", 5);
	if(group == NULL)
		return false;
	Token *by = GetNextWordToken("BY", L"BY", 2);
	if(by == NULL)
		return false;
	while(true)
	{
		Token *exp = GetNextToken();
		if(exp == NULL)
			break;
		ParseExpression(exp);
		Token *comma = GetNextCharToken(',', L',');
		if(comma == NULL)
			break;
	}
	return true;
}
bool SqlParser :: ParseSelectGroupBy ( ) { Token * group = GetNextWordToken ( " " , L" " , 5 ) ; if ( group == NULL ) return false ; Token * by = GetNextWordToken ( " " , L" " , 2 ) ; if ( by == NULL ) return false ; while ( true ) { Token * exp = GetNextToken ( ) ; if ( exp == NULL ) break ; ParseExpression ( exp ) ; Token * comma = GetNextCharToken ( ' ' , L' ' ) ; if ( comma == NULL ) break ; } return true ; }
GROUP BY clause in SELECT statement
GROUP BY clause in SELECT statement
// Parse group expressions // An GROUP BY expression  // Must be comma if next expression exists