Customs Report Software managed

Customs Report Software managed

Hi All!

I'm using AseetExplorer 
Version : 6.1.0
Build Number : 6131

DB: Mysql 

I want to add one more column " Last Logged In User" into this query as below. Could you please help me correct the query? 

select WORKSTATIONNAME 'Workstation', SOFTWARENAME 'Software', rest.DISPLAYSTATE 'State',aau.FIRST_NAME 'User', dd.DEPTNAME 'Department', sdorg.NAME 'Site',PRODUCTKEY 'License Key',SOFTWAREUSAGE 'Usage', (SELECT CASE WHEN sinf.LICENSEID IS NULL THEN 'No' ELSE 'Yes' END) 'Is Licensed' from SoftwareList slist  LEFT JOIN SoftwareInfo sinf ON slist.SOFTWAREID = sinf.SOFTWAREID LEFT JOIN SystemInfo sys ON sinf.WORKSTATIONID = sys.WORKSTATIONID LEFT JOIN SoftwareType stype ON slist.SOFTWARETYPEID = stype.SOFTWARETYPEID  LEFT JOIN SWInstallationKeyInfo swins ON sinf.SOFTWAREINFOID = swins.SOFTWAREINFOID LEFT JOIN WmiSwUsageInfo uinf ON sinf.SOFTWAREINFOID = uinf.SOFTWAREINFOID  LEFT JOIN Resources res ON sys.WORKSTATIONID = res.RESOURCEID LEFT JOIN ResourceOwner reso ON res.RESOURCEID = reso.RESOURCEID LEFT JOIN DepartmentDefinition dd ON reso.DEPTID = dd.DEPTID LEFT JOIN SDUser sdu ON reso.USERID = sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID = aau.USER_ID LEFT JOIN ResourceLocation ON res.RESOURCEID = ResourceLocation.RESOURCEID LEFT JOIN SiteDefinition sd ON ResourceLocation.SITEID = sd.SITEID LEFT JOIN SDOrganization sdorg ON sd.SITEID = sdorg.ORG_ID LEFT JOIN ResourceState rest ON res.RESOURCESTATEID = rest.RESOURCESTATEID WHERE SOFTWARETYPE = 'Managed' <SITE_CRITERIA> ORDER BY 2

Thank You so much