Sample Code:
List<Group> TempPGList = new List<Group>();
String SOQL = ‘SELECT Id, Name FROM Group WHERE Type = ‘Regular”;
TempPGList = Database.Query(SOQL);