AS SELECT DISTINCT SqlTables.SqlTableID, 
			SqlTables.TableName, 
			Paths.PathStr,
			Occurrences.StartRow,
			ProgramTypes.ProgramType
FROM   (SqlTables LEFT JOIN
       Occurrences ON SqlTables.OccurID = Occurrences.OccurID) LEFT JOIN
       Paths ON Occurrences.PathID = Paths.PathID
       LEFT JOIN programs on programs.ProgramID=Occurrences.ProgID
       LEFT JOIN ProgramTypes ON ProgramTypes.ProgramTypeID=programs.ProgramTypeID
WHERE   (SqlTables.SqlTableID IN (Select * from #numeric_param_temp))
ORDER BY SqlTables.TableName
