Hello all.
I am rather inexperienced at SQL and I am facing a problem for which I would appreciate some help:
I have a table A which looks like:
ID User Item Rating
-------------------------------------
1 User1 Item1 SomeRating1
2 User1 Item2 SomeRating2
3 User2 Item1 SomeRating3
etc...The users can have ratings for more than one items and each item can have ratings from more than one users.
I want to copy the ratings to another table B that will look like this:
User Item1 Item2 Item3 ... ItemN
-----------------------------------------------------------
User1 SomeRating1 SomeRating2
User2 SomeRating3
User3
...
UserN
Where the user-item pair "coordinates" will be updated with the corresponding Rating value from table A (if no rating exists for the pair, it will remain NULL).
Any insights on how I could do such a thing?
I am rather inexperienced at SQL and I am facing a problem for which I would appreciate some help:
I have a table A which looks like:
ID User Item Rating
-------------------------------------
1 User1 Item1 SomeRating1
2 User1 Item2 SomeRating2
3 User2 Item1 SomeRating3
etc...The users can have ratings for more than one items and each item can have ratings from more than one users.
I want to copy the ratings to another table B that will look like this:
User Item1 Item2 Item3 ... ItemN
-----------------------------------------------------------
User1 SomeRating1 SomeRating2
User2 SomeRating3
User3
...
UserN
Where the user-item pair "coordinates" will be updated with the corresponding Rating value from table A (if no rating exists for the pair, it will remain NULL).
Any insights on how I could do such a thing?