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 Answer