Link to home
Start Free TrialLog in
Avatar of MSSC_support
MSSC_supportFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Displaying data from the same table value but in a different column

I am trying to write a report where a particular record can have more than one record associated with it on another table. The problem is I want to see it for that same record in a different column so that we can see it all as a bigger picture. I have tried to use aliases but I do not know how to get the data to appear inside those columns. Below is the main query but I also want to add the information for activity value description with a different activity 'STUD' to go along with 'FINSUP'

select c.label_name, c.status, a.activity_value_desc as Financial_Support_Type, a.activity_value_desc as student_status 
FROM contacts C

INNER JOIN contact_categories cc ON cc.contact_number = c.contact_number 
INNER JOIN activity_values A ON a.activity_value = cc.activity_value 

WHERE cc.activity = 'FINSUP' 

ORDER BY c.label_name

Open in new window

Avatar of MSSC_support
MSSC_support
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

As you can see in the image below, I have seperated out the columns I want but I want the last column to display the information for the activity_value 'STUD' rather than the same information in ' FINSUP'

User generated image
ASKER CERTIFIED SOLUTION
Avatar of John_Vidmar
John_Vidmar
Flag of Canada 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
Hi John,

The above failed to bring back any results. I may see what I can do with it to however.

Thanks,
Jayson
I managed to get it working using the segment of SQL provided.