i have a database sample that looks like this:-

enter image description here

as you can see my student master id is repeated. i want student master id to appear only once (in one row) can corresponding roll numbers to appear in columns. like this:-

enter image description here

  • Did you try something on your own? – JSapkota Jan 12 '18 at 5:16
  • i tried pivot but it is not working as it only accepts aggregate query like count, min,max,avg which is not required in this case. – sagar limbu Jan 12 '18 at 5:25
  • Although it is not required you can use min or max with a pivot solution – McNets Jan 12 '18 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.