I have a SQL command which has a lot of INNER JOINs. From a master table having 20 records, I need to create a report with several fields. One of the INNER JOINs has several matching records. I need to obtain the related MIN(ID) and the MAX(NoStatus) in the master report. Basically, if the INNER JOIN has 7 possibilities, I need the ID of the first record and the status of the last record. What would be the simplest way to achieve that?