Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Pivot Table without Aggregate?

$
0
0

I am trying to write a query that lists the Employee assigned to Roles for the selected Projects.

The information is stored in 3 separate Tables with one table that links the 3 together.

[Project] Table, with [ID], [Description] fields

[Project_Role] Table, with [ID], [Description] fields

[Employee] Table, with [ID], [ScreenName] fields

[Project_Role_Assigned] Table with [Project], [Role], [Employee] fields which correspond to the [ID] columns of the Project, Project_Role and Employee tables respectively.

I'm looking for the data to return as...

Columns: Project                           <Project_Role.Description 1>             <Project_Role.Description 2> etc.

Values:    <Project.Description>    <Employee.ScreenName for Role1>   <Employee.ScreenName for Role2> etc.

It sounds like I need a Pivot table but all the examples I'm finding are for aggregate values and I just want to display the linked values.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>