Aggregat-oder join-strings in linq to sql-Abfrage (SQL-Server)

Tabelle wie

ID | Name | City
1  | X    | Y
2  | Z    | Y
3  | W    | K

Will ich ein Ergebnis wie

ID | Description
1  | Y (X, Z)
3  | K (W)

Habe ich versucht, etwas wie

From C In Clients Group C By C.ID, C.City _
Into G = Group Select New With {.ID = ID, .Description = City & _
" (" & (From C In Clients Select C.Name).Aggregate(Function(X, Y) X & ", " & Y) & ")"}

Gab mir eine Fehlermeldung "Die Abfrage der operator "Aggregat" wird nicht unterstützt."
Habe auch versucht

From C In Clients Group C By C.ID, C.City _
Into G = Group Select New With {.ID = ID, .Description = City & _
" (" & String.Join((From C In Clients Select C.Name).ToArray, ", ") & ")"}

Gab mir die Fehlermeldung "keine unterstützte übersetzung in SQL"

So, wie kann ich dies tun?

InformationsquelleAutor ariel | 2010-08-06
Schreibe einen Kommentar