MySQL Forums
Forum List  »  Newbie

naming a column in a table with the same name as another table in the same db
Posted by: Nick Lombardi
Date: June 21, 2005 01:08AM

Hello

In creating an online testing system, I need to name a column in a student table to hold the score for exams which are in separate tables, and I thought the most straightforward way was to give them the same names. As this was an afterthought, I renamed the column in the student table using ALTER TABLE command.
Now, when I try to select from the exam table, I get an error in query saying the old column name in the student table is an unknown field.

Error in query:SELECT correct_answer FROM sampletest WHERE id = '2"'.Unknown column 'exam1_grade' in 'field list'

I'm baffled as the test table has nothing to do with the student table.
In the student table I renamed the column 'exam1_grade', to 'sampletest', the same name as the table that holds the questions and answers.

Options: ReplyQuote


Subject
Written By
Posted
naming a column in a table with the same name as another table in the same db
June 21, 2005 01:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.