Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Help with a SELECT statement to return MAX record!
I have a varchar2 field called farm_code with data held in the form "xxxx9999".
For a group of records that have the same "XXXX" part I need a SELECT statement that returns the highest row based on the "9999" value.
I have a statement that seems to work fine but would like to know if this is the best/quickest way of achieving this -
select max(substr(farm_code,5,4))max_num from nvz_farms where substr(farm_code,1,4) = 'BRID';
Any thoughts?
Thanks in advance!
Adrian Harrison Received on Fri Apr 02 1999 - 03:06:33 CST