Friday 15 August 2014

mysql - Using SELECT-FROM-WHERE to combine to specified columns from two tables students and advisors -



mysql - Using SELECT-FROM-WHERE to combine to specified columns from two tables students and advisors -

this code:

select advisor.advisorid, advisor.lastname, advisor.firstname, student.lastname, student.firstname, birthdate, gender, gpa advisors, students student.advisorid = advisor.advisorid order advisor.lastname asc, student.lastname asc limit 0, 1000

this error receiving:

20:25:01 select advisor.advisorid, advisor.lastname, advisor.firstname, student.lastname,student.firstname, birthdate, gender, gpa advisors, students student.advisorid = advisors.advisorid order advisor.lastname asc, student.lastname asc limit 0, 1000 error code: 1054. unknown column 'advisor.advisorid' in 'field list' 0.000 sec

i trying to combine students , advisors tables. in students table need student.advisorid, student.lastname, student.firstname, birthdate, gender, gpa. in advisors table need advisor.lastname, advisorfirstname using select statement.

must sort advisor name pupil name.

the error self explanatory ... advisor.advisorid column or advisor table doesn't exists..you missing s advisor table should advisors

mysql

No comments:

Post a Comment