pivot Result Creation from sql query : I Have My First table like this,It contains platform and their platform code

    +-----------+------+
    | platforms | code |  
    +-----------+------+
    | java      | 1    |  
    +-----------+------+
    | .net      | 2    |  
    +-----------+------+
    | perl      | 3    |
    +-----------+------+

My Second Table Contains

    +-------+------+------++------+
    | pname | code | year || deve |
    +-------+------+------++------+
    | a     | 1    | 2018 || abia |
    +-------+------+------++------+
    | b     | 1    | 2017 || arun |
    +-------+------+------++------+
    | c     | 2    | 2018 || abia |
    +-------+------+------++------+
    | d     | 3    | 2017 || arun |
    +-------+------+------++------+
    | e     | 2    | 2017 || arun |
    +-------+------+------++------+
    | f     | 3    | 2018 || abia |
    +-------+------+------++------+

Result Expected in Pivot Format like given

    +-----+-------+------+------+------+
    | year| deve  | .net | java | perl |
    +-----+-------+------+------+------+
    | 2018| abia  | 1    | 1    |  1   |
    +-----+-------+------+------+------+
    | 2017| arun  | 1    | 1    |  1   |
    +-----+-------+------+------+------+