Hi
I have a problem to joinig Tables of my database in select statement.
I created 3 table in my database . here is my table :
Table 'Persons' with column{ID , Name,Type}
(//ID is primary key , Type is nvarchar with value of 'teacher' or 'student')
Table 'Teachers' with column{TID,Course} //TID is foreign key for Persons.ID
Table 'Student' with column{SID,Grade} //SID is foreign key for Persons.ID
Now I want to select all column of Persons with extra new column wich it's content will be determined by column 'Type'. if Type is teacher it retrieve value of column 'Cource' of Teacher table and if Type is Student it retrieve value of column Grade of Student table . How my select statement.I should be ? hope you understand what I mean .
Thanks for your help.