James Murrell
asked on
How to pivot one column
Hi, gone brain dead again, here is ideal
[staffname] [area]
staffA area1
staffA area2
staffA area3
what i need is
[staffname] [area] [area] [area]
staffA area1 area2 area3
here is full code so far
[staffname] [area]
staffA area1
staffA area2
staffA area3
what i need is
[staffname] [area] [area] [area]
staffA area1 area2 area3
here is full code so far
SELECT staffnames.title, staffnames.fname, staffnames.mname, staffnames.sname, staffnames.mobile, staffnames.email, staffnames.website, staffnames.payroll_report, staffnames.external_payroll_ref, staffnames.payroll_export,
staff_extra.LN, staff_extra.DOB, staff_extra.LE, staff_extra.NK, staff_extra.NKC, staff_extra.PayrollRef, staff_extra.CCTV, staff_extra.CCTV2, staff_extra.CP,
staff_extra.CP2, areas.area
FROM areas INNER JOIN
staff_area ON areas.area_id = staff_area.area_id RIGHT OUTER JOIN
staffnames INNER JOIN
staff_extra ON staffnames.staff_id = staff_extra.staff_id ON staff_area.staff_id = staffnames.staff_id
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have posted the url where you can learn how to build your SQL accordingly.
if you want comma seperated try this
select [staffname],[area] from tablename groupby staffname
select [staffname],[area] from tablename groupby staffname
ASKER
Yes thanks Angel Eyes..... i been reading and reading it but i am confused, sorry..... but i am trying
James
James
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
but still unsure how to do...
lucky in this example it will be only 3,