SELECT *
  FROM
       (
	SELECT  /*enumCLEARQUEST_DEVI_ID*/ AS iss_db,
		si.dbid AS iss_id,
		si.new_num AS iss_num,
	    si.headline AS summary,
		sdef.name AS status,
		si.priority AS priority,
        si.issue_type AS issue_type,
        si.integration_notes AS int_notes,
        si.codereview_reference AS cr_ref,
        si.risk as risk,
        si.related_database_patches as db_patches,
        si.affected_packages as affected_packages
	FROM  CQ_DEVI.admin.software_issue si INNER JOIN CQ_DEVI.admin.statedef sdef ON si.state = sdef.id
	WHERE  si.dbid IN (/*DEVIiss*/)
	) AS issues
ORDER BY iss_num ASC
