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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -