0

Hi..I am fairly new to SQL and need some help writing a script.

I have 2 tables

table 1 is the student data and table 2 is the student schedule data. In table 2 the students have a student id number that is teh same as the student id in table 1. Table 1 also has a student number that is linked to teh student id.

I need to pull all of the columns from the student schedule table 2and I just want the student number that corresponds to the student id pulled from the student table1.

My end result she be a table with all the columns from table 2 (studnet schedule) and the studnet number column from the student table. (table 1)

Any help would be GREATLY appreciated

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by rbrandt
0

If I have followed you correctly, you want to pull all the schedule entries and append the student number which is stored in the student table?

If so the following should work:

SELECT schedule.*, students.student_number

FROM student_schedule schedule, student_table students

WHERE schedule.student_id = students.student_id
0

Thank you soooo much! I am not sure if you could possibly help me with one more thing. I need to join info from several tables. I understand how to write the join statement when using 2 tables but not for more then that.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.