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.releaseinfo as releaseinfo,
	          si.issue_type AS issue_type,
			  si.release_part1,
			  si.release_part2,
			  si.release_part3,
			  si.project,
			  si.product,
			  si.package_ref,
			  si.notes_log,
	          si.description,
			  NULL AS release_id,
			  NULL AS client_ref,
			  NULL AS severity,
			  NULL AS cr_internal,
			  NULL AS cr_external,
			  sp.fullname AS submitter,
	          si.submit_date,
			  ow.fullname AS owner,
			  ap.fullname AS approver
       FROM CQ_DEVI.admin.software_issue si INNER JOIN
            CQ_DEVI.admin.statedef sdef ON si.state = sdef.id INNER JOIN
            CQ_DEVI.admin.users sp ON si.submitter = sp.dbid INNER JOIN
            CQ_DEVI.admin.users ow ON si.owner = ow.dbid INNER JOIN
            CQ_DEVI.admin.users ap ON si.approver = ap.dbid
		WHERE si.dbid IN (/*DEVIiss*/)
	) AS issues
ORDER BY iss_num ASC
