traport
asked on
SQL Group BY - need help with syntax/usability & ColdfFusion
I have a query:
which produces these results:
I don't know if it's possible, but I'd like to group the results by personLast so I could produce rows of data like this:
that only list the personUnit once, then the personID multiple times with their information.
I hope this makes sense. I doubt it does! Feel free to ask!
<cfquery name="qry_getEdQueue" datasource="#request.DSN#">
SELECT
DISTINCT tblActivities.activityID
, tblActivities.activityApprovedDate
, tblActivityAuthors.personID
, tblActivityAuthors.resumeDisplay
, tblPerson.personType
, tblPerson.personLast
, tblPerson_RTIDetail.personUnit
, tblCitations.citationFull
, lutblActivityResumeStatus.activityResumeStatus
FROM tblActivities
JOIN tblActivityAuthors ON tblActivities.activityID = tblActivityAuthors.activityID
JOIN tblPerson ON tblActivityAuthors.personID = tblPerson.personID
JOIN tblPerson_RTIDetail ON tblPerson_RTIDetail.personRTIID = tblPerson.personRTIID
JOIN tblCitations ON tblActivityAuthors.activityID = tblCitations.activityID
LEFT JOIN lutblActivityResumeStatus ON lutblActivityResumeStatus.activityResumeStatusID = tblActivityAuthors.activityResumeStatus
WHERE activityProcessingStatus = '12'
AND tblActivityAuthors.resumeDisplay = '1'
<!--- do not include non-RTI Authors or Groups which are lutblPersonTypes LT 4 --->
AND tblPerson.personType < 4
<!--- place units to look for with Editor Admin here --->
ORDER BY tblPerson_RTIDetail.personUnit, tblPerson.personLast
</cfquery>
which produces these results:
I don't know if it's possible, but I'd like to group the results by personLast so I could produce rows of data like this:
that only list the personUnit once, then the personID multiple times with their information.
I hope this makes sense. I doubt it does! Feel free to ask!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any Time
ASKER