How to: retreive school name using school id
am 22.04.2006 17:52:47 von jullietta.jung
HI,
I have a Questionnaire table that has a column "SchoolId"(int).
I want to return the questionnaire table with the name of the school
rather than the SchoolId (schoolid and schoolName are stored in another
table).
Hope this makes sense.
Thanks
Jules
Re: How to: retreive school name using school id
am 23.04.2006 01:57:25 von Bill Karwin
jullietta.jung@gmail.com wrote:
> HI,
>
> I have a Questionnaire table that has a column "SchoolId"(int).
> I want to return the questionnaire table with the name of the school
> rather than the SchoolId (schoolid and schoolName are stored in another
> table).
Sounds like you need to make a join between the two tables:
SELECT s.schoolName, q.question, q.answer
FROM school AS s JOIN questionnaire AS q USING (SchoolId)
Regards,
Bill K.