0

I have 3 tables

  • DimInstitution (InstitutionKey, name)
  • BridgeInstitutionRole (InstitutionKey, InstitutionRoleKey)
  • DimInstitutionRole (InstitutionRoleKey, InstitutionRoleCode)

But, one InstitutionKey can have many InstitutionRoleCode. Please see the example

enter image description here

Now, InstitutionRole can have new values as well. I want to create the dynamic InstitutionRoleCode columns based on its value.

My expected output will be:

enter image description here

Can anyone please help me?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ash Atre
  • 305
  • 4
  • 17
  • 2
    Possible duplicate of [Convert Rows to columns using 'Pivot' in SQL Server](https://stackoverflow.com/questions/15931607/convert-rows-to-columns-using-pivot-in-sql-server) – RoMEoMusTDiE Jan 23 '18 at 21:19
  • you need to do more digging, go to http://sqlfiddle.com/ and muck up some data – RoMEoMusTDiE Jan 23 '18 at 21:38

0 Answers0