lape@cs.utk.edu (Bryon S. Lape) (03/01/91)
I need to have a computed column be a result of a WHERE clause type cross table reference. Or in simpler terms.... Say table Letter_Grades have two columns like so: Letter Number ---------- ------------ A+ 4.00 A 4.00 A- 3.67 . . . . F 0.00 Now another table holds grades for a student. Those grades are entered by a letter, but I need to compute the quality points (credit hours * grade) by looking up the corresponding Letter ==> Number grade. I have tried something like this: ENGL1011 ------------ (Number IN Letter_Grades WHERE Letter = ENGL1011) but this causes the column to be test field holding the above string. Is what I need impossible??? Bryon Lape
rob.bbs@shark.cs.fau.edu (Robert Rittenhouse) (03/05/91)
lape@cs.utk.edu (Bryon S. Lape) writes: > > I need to have a computed column be a result of a WHERE clause type > cross table reference. Or in simpler terms.... > > Say table Letter_Grades have two columns like so: > > Letter Number > ---------- ------------ > A+ 4.00 > A- 3.67 > . . > . . > F 0.00 > > Now another table holds grades for a student. Those grades are > entered by a letter, but I need to compute the quality points (credit hours > * grade) by looking up the corresponding Letter ==> Number grade. I have > tried something like this: > > ENGL1011 > ------------ > > (Number IN Letter_Grades WHERE Letter = ENGL1011) > > but this causes the column to be test field holding the above > string. Is what I need impossible??? > > Bryon Lape Yes. What might work is a view: SELECT student.*, number from student, letter_grades where student.letter = grade.letter I'm using Rbase in our DBMS class here. Rob R.