Guest User

Untitled

a guest
Jun 19th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. I need SQL to turn this:
  2.  
  3. | user_id | question_name | answer |
  4. | 1 | 'q1' | 'a' |
  5. | 1 | 'q2' | 'b' |
  6. | 1 | 'q3' | 'c' |
  7. | 2 | 'q1' | 'd' |
  8. | 2 | 'q2' | 'e' |
  9. | 2 | 'q3' | 'f' |
  10.  
  11. Into this:
  12.  
  13. | user_id | q1 | q2 | q3 |
  14. | 1 | 'a' | 'b' | 'c' |
  15. | 2 | 'd' | 'e' | 'f' |
  16.  
  17. Obviously the data is a lot more complex, but I need the basic idea to get me started
Add Comment
Please, Sign In to add comment