Link to home
Start Free TrialLog in
Avatar of softsolvers
softsolvers

asked on

Select multiple rows into one row, MS SQL

I have two tables A,B having structure in Sql server 2000
A- studentID int, studentName varchar(200)
having records
      1 a1
      2 a2
      3 a3

B- studentID int attribute varchar(50)
      1 x
      1 y
      1 z
      1 a
      1 b
      1 c
      2 p
      2 q
      2 r
      3 m
      3 n
      3 o
Now when i run query
Select studentID,StudentName,attribute from A,B where a.studentID= b.studentID
Gives

1 a1 x
1 a1 y
1 a1 z
...........
.........
Is it possible in any way that i get records like
1 a1 x y z a b c
2 a2 p q r
3 a3 m n o


ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial