Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 982537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:42:49+00:00 2026-05-16T04:42:49+00:00

Given a table like ID | Name | City 1 | X | Y

  • 0

Given a table like

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

I want to produce a result like

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

I tried something like

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) & ")"}

Which gave me an error “The query operator ‘Aggregate’ is not supported.”
Also tried

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, ", ") & ")"}

Which gave me the error “no supported translation to SQL”

So, how can i do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:42:50+00:00Added an answer on May 16, 2026 at 4:42 am

    I hacked this in C# and it seems to give what you want. I’ll leave the translation to VB up to you.

    var clients = from c in context.Clients 
                  group c by c.City into cities 
                  select new {
                      ID = cities.First().ID,
                      City = cities.Key, 
                      Names = string.Join(",", (from n in cities select n.Name).ToArray()) 
                  };
    
    foreach (var c in clients) {
        Console.WriteLine(string.Format("{0}| {1} ({2})", c.ID, c.City, c.Names));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have SELECT name FROM table which gives me something like foo
Given a table like this: [Last Name] [First Name] [DepartmentID] --------------------------------------- Doe John 1
In C# Given a hash table like {id:'1', name:'foo'} How can I dynamically create
hi there imagine I have a table like this Id | Name | City
Given a table like: CREATE TABLE MyTable ( MyColumn NUMBER NOT NULL ); I
Given: CREATE TABLE foo (id BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); I'd like to
Given a MySQL table of real estate data, I would like to generate a
Given the following html table, I would like to control the width of the
Given a query like: SELECT table1.field1 FirstField, table2.field2 SecondField FROM table1 INNER JOIN table2
Given a table name and column name in a pair of variables, can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.