470,613 Members | 2,410 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

How to: retreive school name using school id

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

Apr 22 '06 #1
2 1120
Sorry I should add that there are 2 schoolId coloumns in the
questionnaire table.
I school id for the visiting school and another for the home school.

- Jules

Apr 22 '06 #2
ju************@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.
Apr 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Goran Djuranovic | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.