mysql - Placing all the grades of student1 -
i have table subject
has columns subject code
, user_id
, grade
. have table students.
student table:
| user_id | name | +---------+------+ | 17000 | elle |
subject table:
| subjcode | user_id | grade | +----------+---------+-------+ | os1 | 17000 | 90 | | micro | 17000 | 90 |
what right query output this?
| user_id | os1 | micro1 | +---------+-----+--------+ | 17000 | 90 | 90 |
this requires combine results multiple line in 1 line, not handled sql query. plus cannot variable number of fields results (what if there 5 subject matters). best handled @ display level proper language.
of course stored procedure that's whole other subject :-)
Comments
Post a Comment