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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.