added groupby exchange SQLite statement