On Wed, Feb 14, 2001 at 11:27:34AM +1100, Stacy Mader wrote:
> 
> So my question is: for fault_no's with multiple response_no's, can
> I modify the SQL to just
> return results with the latest response_no only? For example, from the
> above query, I'd
> like to have returned:
> 
> '1189','653','Drive system - az'
> '1190','465','Telescope control system'

Perhaps you want MAX with a GROUP BY clause?

SELECT report.fault_no,
       MAX(response.response_no),
       response.category
FROM   report,
       response
WHERE  report.fault_no = response.fault_no(+)
GROUP BY report.fault_no,
         response.category


Ronald

Reply via email to