Hi Simon,
Yes, I have a date/time field in the format "DD-MON-YYYY HH24:MI"
Peter Bruhn suggested I try:
SELECT DISTINCT fault_no ,one_line_summary FROM report_response
WHERE (reported_by LIKE '%J BLOGGS%' ) order by fault_no DESC;
This appears to work, but I'll look into views as well...
Many thanks...
Regards,
Stacy.
Simon Oliver wrote:
> Does your table have a "submitted_date" field or some other serialised
> or chronological field? If not your stuffed because RDBMs do not
> guarantee the order records are stored in.
>
> If you do have a "submitted_date" field then you can create a view that
> is grouped by max(submitted_date) and select against this query.
>
> Stacy Mader wrote:
>
> > Hi all,
> >
> > I have a table (report_response) which has (among others)
> > fault_no and response_no fields. Now a fault_no can have
> > multiple response_no's.
> >
> > The thing is, when I issue the following SQL:
> >
> > SELECT fault_no ,one_line_summary FROM report_response
> > WHERE (reported_by LIKE '%J BLOGGS%' ) order by fault_no DESC
> >
> > my returned list displays:
> >
> > 1355 Glish leftovers on sagitta
> > 1350 Site phones
> > 1350 Site phones
> >
> > See those multiple occurances of 1350? This means there are 2 responses
> > to the fault_no = 1350. How can I fudge the SQL
> > to select the last response_no submitted?
> >
> > Regards,
> >
> > Stacy.
> >
> > BTW: Using DBI:1.14 with Oracle 7.3.3
>
> --
> Simon Oliver
>
> ---