Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: can this be done more elegant?
This works elegantly if you only want a grouped result, for instance
(in my example):
WITH r_curvs AS (SELECT * FROM test_ride WHERE event_type='curve_R')
SELECT MAX(time)
FROM r_curvs;
If you want the whole record, you end up with
WITH r_curvs AS (SELECT * FROM test_ride WHERE event_type='curve_R')
SELECT *
FROM r_curvs
WHERE time = (SELECT MAX(time) FROM r_curvs;
which is only semantically more elegant (you don't have to write out the select twice). I doubt however if the parser handles this more efficient than my example. Received on Thu Apr 20 2006 - 01:37:33 CDT