SELECT chdt.changeid AS "Change ID",
chdt.title AS "Title",
orgaaa.first_name AS "Change Requester",
ownaaa.first_name AS "Change Owner",
catadef.categoryname AS "Category",
subcatadef.NAME AS "Subcategory",
itemdef1.NAME AS "Item",
res.ciname "Asset" FROM changedetails chdt
LEFT JOIN sduser orgsd
ON chdt.initiatorid = orgsd.userid
LEFT JOIN aaauser orgaaa
ON orgsd.userid = orgaaa.user_id
LEFT JOIN sduser ownsd
ON chdt.technicianid = ownsd.userid
LEFT JOIN aaauser ownaaa
ON ownsd.userid = ownaaa.user_id
LEFT JOIN categorydefinition catadef
ON chdt.categoryid = catadef.categoryid
LEFT JOIN subcategorydefinition subcatadef
ON chdt.subcategoryid = subcatadef.subcategoryid
LEFT JOIN itemdefinition itemdef1
ON chdt.itemid = itemdef1.itemid
LEFT JOIN changetoci cta
ON cta.changeid = chdt.changeid
LEFT JOIN ci res
ON cta.ciid = res.ciid
ORDER BY 1