Advertisement

07.11.2005 at 07:36AM PDT, ID: 21487136
[x]
Attachment Details

Pivot data, sort of...

Asked by sexyrexy in MS SQL Server

Tags: pivot, data

I have several tables normalized around one table - like so:

Clinic data table (Address, Phone, Fax, etc.)
Services offered - clinicID, serviceText
Staff - clinicID, userID

Essentially what I need to do is return a dataset like so:

ClinicID | Address | ... | service1 | service2 | service3 | service4 | service5 | service6 | staff1 | staff2 | staff3 | staff4 | staff5

If there are fewer than 6 services, 5 staff, etc. for a clinic, the remaining columns should return null. If there are more, they should be left out.Start Free Trial
[+][-]07.11.2005 at 07:44AM PDT, ID: 14412739

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 07:47AM PDT, ID: 14412776

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 08:20AM PDT, ID: 14413110

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: pivot, data
Sign Up Now!
Solution Provided By: Hilaire
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.11.2005 at 08:35AM PDT, ID: 14413278

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 08:37AM PDT, ID: 14413298

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 08:39AM PDT, ID: 14413313

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 09:11AM PDT, ID: 14413648

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32