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 8805507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:53:06+00:00 2026-06-14T01:53:06+00:00

Let us build 2 tables create table School ( IdSchool int not null PK,

  • 0

Let us build 2 tables

create table School
(
IdSchool int not null PK,
Name     varchar(10) not null
)

create table Prof
(
IdSchool   int not null,
IdProf     int not null,
name       varchar (10)
PK (IdSchool, IdProf)
)

I would like to build query like this:

IdSchool, Prof.Name*
  • prof name should be a list that consist of ALL the profs from the same school.

Now, I know it is not a problem to build a list with a procedure or function, but is there a way to build a query that can return this kind of a result.

P.S. query should return single line, so result table from school left join prof is not a result I want to achieve.

thx.

  • 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-06-14T01:53:09+00:00Added an answer on June 14, 2026 at 1:53 am
    SELECT distinct Idschool, profs
    FROM profs p1
    CROSS APPLY
    (
    select substring((
        SELECT ',' + name 
        FROM profs p2    
        WHERE p1.Idschool = p2.Idschool
        FOR XML PATH('')
        ),2,1000)
        as Profs    
    ) profs
    
    • 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 a type of lookup table which I can build for
Let's say I build an application on top of net.aserve and bordeaux-threads . My
Let's say I want to build a REST service for making notes that looks
I am trying to build a php class that will let me include other
I want to build a flash app to let me and my users snap
I am trying to build a Quadtree data structure(or let's just say a tree)
Is their any notifier which let's you add specific build in the notifier. Right
I'm trying to build a generic grid view in an ASP.NET MVC application. Let
Does anyone have any experiences from recent daily build of AnkhSVN? Please let me
For example, let's say I have a Maven build file that has dependencies located

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.