0

I'm trying to update the column of the table1 with table2. Trying to update column with row values.

Below is the scenario.

Table 1:

Student1 Class Student2   Class   Student3 Class   Student4 Class 
 A1      null  A2          null    A3       null    A4       null 
 A1      null  A2          null    A3       null    A4       null

Table 2:

Student_name  Class
   A1           1
   A2           2
   A3           3
   A4           4
   A1           1
   A2           2
   A3           3
   A4           5

how can i try to this data from row to column?? Need a Output like??

Student1 Class Staudent2   Class   Student3 Class   Student4 Class 
A1        1    A2          2       A3       3       A4       4 
A1        1    A2          2       A3       3       A4       5
Aakeef
  • 29
  • 1
  • 1
  • 6
  • possible duplicate of [update one table with data from another](http://stackoverflow.com/questions/5036918/update-one-table-with-data-from-another) – Vance Sep 24 '15 at 09:15
  • Your table definitions are quite odd... I'm afraid there is no easy way to get 4 in the first row, right-most column of the result table and 5 in the second row, since the tuples (A4,4) and (A4,5) have no specific order and you cannot simply "consume" them one-after-the-other in a join. – Erich Kitzmueller Sep 24 '15 at 09:42
  • Why would you have duplicate values in the second table? – Gordon Linoff Sep 24 '15 at 11:13

0 Answers0