Sql Group By Select Multiple Columns In R